Wildcard query rewrite parameter not working with new wildcard field type?

The Wildcard Query offers a rewrite parameter to influence how Lucene calculates the relevance scores. On keyword fields this works as expected but it does not seem to work with the new wildcard field type which belongs to the keyword family. Is this an expected behavior or a bug?

I think it's safe to assume the rewrite parameter is unsupported. Unlike keyword fields, the wildcard field doesn't have a single indexed token for each term so it has no pre-built count for the document frequency of whole values. Instead it uses an ngram index which obviously has different frequencies for the multiple terms a search string can be broken down into.

Thank you for your reply, that clears things up. Perhaps this should be mentioned in the documentation.

1 Like

Will do. Thanks for flagging. I opened Wildcard field should use constant_score and reject wildcard query `rewrite` param · Issue #69604 · elastic/elasticsearch · GitHub to track

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.