开发者

Combining Lucene's WildcardQuery with FuzzyQuery

开发者 https://www.devze.com 2022-12-21 03:13 出处:网络
Using Lucene.Net 2.4.0 is there some kind of built-in support for joining the results of two different queries that target the same index, similar to the support for targeting two or more indexes with

Using Lucene.Net 2.4.0 is there some kind of built-in support for joining the results of two different queries that target the same index, similar to the support for targeting two or more indexes with a single query?

I'm looking for ways to support both trailing wildcard and fuzzy searches without forcing users to choose one or the other. I could achieve this by executing a wildcard query and a fuzzy search sequentially, and then manually merge the two results and sort by the score of the individual documents, in hopes that their relative scores will make sense.

Is there another way?

To clarify: queries such as "apoca" and "appockalypze" should 开发者_如何学Goboth produce a hit on "Apocalypse Now", given such a document exists in the index, and increasing the fuzzyness from 0.5 to 1 is not really an option.


you could join two or more queries with BooleanQuery

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号