We are talking about Lucene encoding types here, in particular whether the field is indexed as string or numerically. This is amongst other things important to decide which type of query you are using when targeting the indexed field. Unfortunately, the current names in the builtin package are imo a bit misleading. For example, there is NumberBridge and its sub classes. Given that we index numbers now per default numerically one would expect that this bridge 'encodes' numeric values. This is, however, not the case. Out of historic reasons it is using string encoding. You need to use NumericFieldBridge for numeric encoding (leaving aside that this class is an Enum for unexplainable reasons).
So the idea is to have make sure to add the 'encoding' type to each class javadoc. This way the information is at least available, if not directly implied by name (as in NumericEncodingDateBridge vs StringEncodingDateBridge).
And we know how each bridge is 'encoding', just check its implementation.
Does this make things clearer?
|