Package org.apache.solr.schema
Class DateRangeField
- java.lang.Object
- 
- org.apache.solr.schema.FieldProperties
- 
- org.apache.solr.schema.FieldType
- 
- org.apache.solr.schema.AbstractSpatialFieldType<T>
- 
- org.apache.solr.schema.AbstractSpatialPrefixTreeFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
- 
- org.apache.solr.schema.DateRangeField
 
 
 
 
 
- 
- All Implemented Interfaces:
- DateValueFieldType,- SpatialQueryable
 
 public class DateRangeField extends AbstractSpatialPrefixTreeFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy> implements DateValueFieldType A field for indexed dates and date ranges. It's mostly compatible with DatePointField. It has the potential to allow efficient faceting, similar to facet.enum.- See Also:
- NumberRangePrefixTreeStrategy,- DateRangePrefixTree
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.solr.schema.FieldTypeFieldType.DefaultAnalyzer, FieldType.MultiValueSelector
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.solr.schema.AbstractSpatialPrefixTreeFieldTypeDEFAULT_FIELD_VALUES_ARRAY_LEN, FIELD_TYPE_INVARIANTS, grid
 - 
Fields inherited from class org.apache.solr.schema.AbstractSpatialFieldTypeargsParser, ctx, DISTANCE, distanceUnits, FILTER_PARAM, FORMAT, NONE, RECIP_DISTANCE, SCORE_PARAM, shapeReader, shapeWriter, supportedScoreModes
 - 
Fields inherited from class org.apache.solr.schema.FieldTypeANALYZER, args, AUTO_GENERATE_PHRASE_QUERIES, CHAR_FILTER, CHAR_FILTERS, CLASS_NAME, docValuesFormat, ENABLE_GRAPH_QUERIES, falseProperties, FILTER, FILTERS, INDEX, INDEX_ANALYZER, MULTI_TERM, MULTI_TERM_ANALYZER, POLY_FIELD_SEPARATOR, postingsFormat, properties, QUERY, QUERY_ANALYZER, similarity, SIMILARITY, similarityFactory, SYNONYM_QUERY_STYLE, TOKENIZER, trueProperties, TYPE, TYPE_NAME, typeName
 - 
Fields inherited from class org.apache.solr.schema.FieldPropertiesBINARY, DOC_VALUES, INDEXED, LARGE_FIELD, MULTIVALUED, OMIT_NORMS, OMIT_POSITIONS, OMIT_TF_POSITIONS, REQUIRED, SORT_MISSING_FIRST, SORT_MISSING_LAST, STORE_OFFSETS, STORE_TERMOFFSETS, STORE_TERMPAYLOADS, STORE_TERMPOSITIONS, STORE_TERMVECTORS, STORED, TOKENIZED, UNINVERTIBLE, USE_DOCVALUES_AS_STORED
 
- 
 - 
Constructor SummaryConstructors Constructor Description DateRangeField()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.apache.lucene.index.IndexableField>createFields(SchemaField field, Object val)Given aSchemaField, create one or moreIndexableFieldinstancesprotected org.apache.lucene.search.QuerygetSpecializedRangeQuery(QParser parser, SchemaField field, String startStr, String endStr, boolean minInclusive, boolean maxInclusive)Returns a Query instance for doing range searches on this field type.protected StringgetStoredValue(org.locationtech.spatial4j.shape.Shape shape, String shapeStr)Called byAbstractSpatialFieldType.createFields(SchemaField, Object)to get the stored value.protected voidinit(IndexSchema schema, Map<String,String> args)subclasses should initialize themselves with the args provided and remove valid arguments.protected org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategynewPrefixTreeStrategy(String fieldName)DateparseMath(Date now, String rawval)For easy compatibility withDateMathParser.parseMath(Date, String).org.apache.lucene.spatial.prefix.tree.NumberRangePrefixTree.NRShapeparseShape(String str)Create aShapefrom the input stringprotected org.apache.lucene.spatial.query.SpatialArgsparseSpatialArgs(QParser parser, String externalVal)StringshapeToString(org.locationtech.spatial4j.shape.Shape shape)Returns a String version of a shape to be used for the stored value.- 
Methods inherited from class org.apache.solr.schema.AbstractSpatialPrefixTreeFieldTypecheckSchemaField, getIndexAnalyzer, getQueryAnalyzer, newSpatialStrategy, setArgs
 - 
Methods inherited from class org.apache.solr.schema.AbstractSpatialFieldTypecreateField, createSpatialQuery, getDistanceUnits, getFieldQuery, getQueryFromSpatialArgs, getSortField, getSpatialContext, getSpecializedExistenceQuery, getSphereRadius, getStrategy, getSupportedScoreModes, getUninversionType, getValueSource, getValueSourceFromSpatialArgs, isPolyField, newSpatialArgsParser, parseDistanceUnits, write
 - 
Methods inherited from class org.apache.solr.schema.FieldTypecheckSupportsDocValues, createField, getAnalyzerProperties, getClassArg, getDefaultMultiValueSelectorForSort, getDocValuesFormat, getExistenceQuery, getFieldTermQuery, getNamedPropertyValues, getNonFieldPropertyArgs, getNumberType, getNumericSort, getPostingsFormat, getPrefixQuery, getRangeQuery, getRewriteMethod, getSetQuery, getSimilarity, getSimilarityFactory, getSingleValueSource, getSortedNumericSortField, getSortedSetSortField, getSortField, getStringSort, getTypeName, hasProperty, indexedToReadable, indexedToReadable, isExplicitAnalyzer, isExplicitQueryAnalyzer, isMultiValued, isPointField, isTokenized, isUtf8Field, marshalBase64SortValue, marshalSortValue, marshalStringSortValue, multiValuedFieldCache, readableToIndexed, readableToIndexed, restrictProps, setIndexAnalyzer, setIsExplicitAnalyzer, setIsExplicitQueryAnalyzer, setQueryAnalyzer, setSimilarity, storedToIndexed, storedToReadable, supportsAnalyzers, toExternal, toInternal, toNativeType, toObject, toObject, toString, treatUnboundedRangeAsExistence, unmarshalBase64SortValue, unmarshalSortValue, unmarshalStringSortValue, useDocValuesAsStored, write
 
- 
 
- 
- 
- 
Method Detail- 
initprotected void init(IndexSchema schema, Map<String,String> args) Description copied from class:FieldTypesubclasses should initialize themselves with the args provided and remove valid arguments. leftover arguments will cause an exception. Common boolean properties have already been handled.- Overrides:
- initin class- AbstractSpatialPrefixTreeFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
 
 - 
newPrefixTreeStrategyprotected org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy newPrefixTreeStrategy(String fieldName) - Specified by:
- newPrefixTreeStrategyin class- AbstractSpatialPrefixTreeFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
 
 - 
createFieldspublic List<org.apache.lucene.index.IndexableField> createFields(SchemaField field, Object val) Description copied from class:FieldTypeGiven aSchemaField, create one or moreIndexableFieldinstances- Overrides:
- createFieldsin class- AbstractSpatialFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
- Parameters:
- field- the- SchemaField
- val- The value to add to the field
- Returns:
- An array of IndexableField
- See Also:
- FieldType.createField(SchemaField, Object),- FieldType.isPolyField()
 
 - 
getStoredValueprotected String getStoredValue(org.locationtech.spatial4j.shape.Shape shape, String shapeStr) Description copied from class:AbstractSpatialFieldTypeCalled byAbstractSpatialFieldType.createFields(SchemaField, Object)to get the stored value.- Overrides:
- getStoredValuein class- AbstractSpatialFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
 
 - 
shapeToStringpublic String shapeToString(org.locationtech.spatial4j.shape.Shape shape) Description copied from class:AbstractSpatialFieldTypeReturns a String version of a shape to be used for the stored value.The format can be selected using the initParam format={WKT|GeoJSON}- Overrides:
- shapeToStringin class- AbstractSpatialFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
 
 - 
parseShapepublic org.apache.lucene.spatial.prefix.tree.NumberRangePrefixTree.NRShape parseShape(String str) Description copied from class:AbstractSpatialFieldTypeCreate aShapefrom the input string- Overrides:
- parseShapein class- AbstractSpatialFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
 
 - 
parseMathpublic Date parseMath(Date now, String rawval) For easy compatibility withDateMathParser.parseMath(Date, String).
 - 
parseSpatialArgsprotected org.apache.lucene.spatial.query.SpatialArgs parseSpatialArgs(QParser parser, String externalVal) - Overrides:
- parseSpatialArgsin class- AbstractSpatialFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
 
 - 
getSpecializedRangeQueryprotected org.apache.lucene.search.Query getSpecializedRangeQuery(QParser parser, SchemaField field, String startStr, String endStr, boolean minInclusive, boolean maxInclusive) Description copied from class:FieldTypeReturns a Query instance for doing range searches on this field type.SolrQueryParsercurrently passespart1andpart2as null if they are '*' respectively.minInclusiveandmaxInclusiveare both true currently by SolrQueryParser but that may change in the future. Also, other QueryParser implementations may have different semantics.Sub-classes should override this method to provide their own range query implementation. They should strive to handle nulls in part1and/orpart2as well as unequalminInclusiveandmaxInclusiveparameters gracefully.This method does not, and should not, check for or handle existence queries, please look at FieldType.getRangeQuery(org.apache.solr.search.QParser, org.apache.solr.schema.SchemaField, java.lang.String, java.lang.String, boolean, boolean)for that logic.- Overrides:
- getSpecializedRangeQueryin class- AbstractSpatialFieldType<org.apache.lucene.spatial.prefix.NumberRangePrefixTreeStrategy>
- Parameters:
- parser- the- QParsercalling the method
- field- the schema field
- startStr- the lower boundary of the range, nulls are allowed.
- endStr- the upper boundary of the range, nulls are allowed
- minInclusive- whether the minimum of the range is inclusive or not
- maxInclusive- whether the maximum of the range is inclusive or not
- Returns:
- a Query instance to perform range search according to given parameters
 
 
- 
 
-