Combining Lucene's WildcardQuery with FuzzyQue

2019-02-28 11:56发布

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 both 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.

1条回答
Evening l夕情丶
2楼-- · 2019-02-28 12:47

you could join two or more queries with BooleanQuery

查看更多
登录 后发表回答