Question

I am using a WildcardQuery on documents and I see that the result documents all of them have a score of 0.5. I read that queries like WildcardQuery do not affect the scoring of documents and now I am wondering what is the cause of the score to be 0.5.

I am using this simple query:

WildcardQuery wq = new WildCardQuery("filed_name", "book");
Était-ce utile?

La solution

WildcardQuery certainly does affect scoring. It uses a CONSTANT_SCORE_AUTO_REWRITE, which may be what you are referring to. That means that fields that match the WildcardQuery each have a equal boost to the score added by that match. There is, however, none of the typical Similarity logic (tf-idf, for instance) applied for the WildcardQuery's matches.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top