I'm running some query on Lucene.net
that it is returning several documents
with only a difference in the unit
attribute
the query is: +house:5757 street:"madeup" street:creek* unit:114* remainder:66103* remainder:"114 miami fl 66103"
and i get several documents with
house:5757 street:"madeup" street:creek unit:100 remainder:"100 miami fl 66103"
house:5757 street:"madeup" street:creek unit:101 remainder:"101 miami fl 66103"
house:5757 street:"madeup" street:creek unit:102 remainder:"102 miami fl 66103"
...
house:5757 street:"madeup" street:creek unit:114 remainder:"114 miami fl 66103"
...
...
house:5757 street:"madeup" street:creek unit:200 remainder:"200 miami fl 66103"
i am retrieving the records with a
var collector = TopScoreDocCollector.create(25, true);
searcher.Search(topQuery, collector);
the problematic part is that all these documents are coming with exactly the same score 5.09505, so the unit match is not really making any difference to the document score
when the documents are indexed, this is how i'm indexing the unit
field:
doc.Add(new Field("unit", unitValue, Field.Store.YES, Field.Index.NOT_ANALYZED));
Edit some googling shows that the RewriteMethod needs to be changed, but not sure exactly because i haven't seen a complete example