Clarify relationship between @NumericField and NumericFieldBridge in the documentation
Description
Activity
Hardy Ferentschik October 9, 2013 at 1:23 PM
Thanks for the clarification.
The sentence you mention about approximation is also cryptic but that's another topic
I changed it as part of the review of @NumericField
. I hope it is clearer now.
Emmanuel Bernard October 9, 2013 at 12:33 PM
hey, the code is at
https://github.com/emmanuelbernard/ticket-monster/blob/hibernate-search/demo/src/main/java/org/jboss/jdf/example/ticketmonster/model/Show.java#L129
and https://github.com/emmanuelbernard/ticket-monster/blob/hibernate-search/demo/src/main/java/org/jboss/jdf/example/ticketmonster/model/search/PriceMinBridge.java
AFAI guessed I did not need the @NumericField annotation but the doc did leave me unsatisfied on that very question. As you say, if you use a custom bridge, then @NumericField is not useful but the doc was not clear on that.
The sentence you mention about approximation is also cryptic but that's another topic
Hardy Ferentschik October 9, 2013 at 11:10 AM
Hardy Ferentschik October 9, 2013 at 10:40 AM
> I got very confused. I did not know if I needed to add the @NumericField annotation.
Did you get any problems when you specified it? Really both should work.
Hardy Ferentschik October 8, 2013 at 1:51 PM
Any chance you can add your example here? One of the things @NumericField
triggers is the right selection of a bridge in BridgeFactory
. If you specify a custom bridge impl as part of @Field
which is an instance of NumericFieldBridge
you make the choice this way. Bottom line is really that for numeric values LuceneOptions.addNumericFieldToDocument
has to be used.
Anything you find in particular confusing/missing in the documentation. I had a quick look and I am not quite sure what to make of this:
It is possible to use a custom NumericFieldBridge assuming you can deal with the approximation during type transformation:
However, that might be a different issue!?
I had to write a
NumericFieldBridge
taking a collection as input and pushing the min of a property of the entity stored in the collection.I got very confused. I did not know if I needed to add the
@NumericField
annotation. I thought yes, but then there seems to be undocumented behavior around@NumericField
and Iterable so I opted out. So far it seems to work.