Example usage for org.apache.lucene.spatial.bbox BBoxStrategy SUFFIX_MINX

List of usage examples for org.apache.lucene.spatial.bbox BBoxStrategy SUFFIX_MINX

Introduction

In this page you can find the example usage for org.apache.lucene.spatial.bbox BBoxStrategy SUFFIX_MINX.

Prototype

String SUFFIX_MINX

To view the source code for org.apache.lucene.spatial.bbox BBoxStrategy SUFFIX_MINX.

Click Source Link

Usage

From source file:org.apache.solr.schema.BBoxField.java

License:Apache License

private void registerSubFields(IndexSchema schema, String name, FieldType numberType, FieldType booleanType) {
    register(schema, name + BBoxStrategy.SUFFIX_MINX, numberType);
    register(schema, name + BBoxStrategy.SUFFIX_MAXX, numberType);
    register(schema, name + BBoxStrategy.SUFFIX_MINY, numberType);
    register(schema, name + BBoxStrategy.SUFFIX_MAXY, numberType);
    register(schema, name + BBoxStrategy.SUFFIX_XDL, booleanType);
}

From source file:org.apache.solr.spatial.pending.BBoxFieldType.java

License:Apache License

@Override
public void inform(IndexSchema schema) {
    FieldType doubleType = schema.getFieldTypeByName(doubleFieldName);
    FieldType booleanType = schema.getFieldTypeByName(booleanFieldName);

    if (doubleType == null) {
        throw new RuntimeException("Can not find double: " + doubleFieldName);
    }// w w w  .j  ava  2  s.c  o  m
    if (booleanType == null) {
        throw new RuntimeException("Can not find boolean: " + booleanFieldName);
    }
    if (!(booleanType instanceof BoolField)) {
        throw new RuntimeException("must be a booleanField: " + booleanType);
    }
    if (!(doubleType instanceof TrieDoubleField)) {
        throw new RuntimeException("double must be TrieDoubleField: " + doubleType);
    }

    TrieField df = (TrieField) doubleType;
    precisionStep = df.getPrecisionStep();

    List<SchemaField> fields = new ArrayList<SchemaField>(schema.getFields().values());
    for (SchemaField sf : fields) {
        if (sf.getType() == this) {
            String name = sf.getName();
            register(schema, new SchemaField(name + BBoxStrategy.SUFFIX_MINX, doubleType, fieldProps, null));
            register(schema, new SchemaField(name + BBoxStrategy.SUFFIX_MAXX, doubleType, fieldProps, null));
            register(schema, new SchemaField(name + BBoxStrategy.SUFFIX_MINY, doubleType, fieldProps, null));
            register(schema, new SchemaField(name + BBoxStrategy.SUFFIX_MAXY, doubleType, fieldProps, null));
            register(schema, new SchemaField(name + BBoxStrategy.SUFFIX_XDL, booleanType, fieldProps, null));
        }
    }
}