Lucene - Wildcards in phrases

前端 未结 7 937
小鲜肉
小鲜肉 2021-01-04 11:50

I am currently attempting to use Lucene to search data populated in an index.

I can match on exact phrases by enclosing it in brackets (i.e. \"Processing Documents\"

7条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-04 12:03

    Use a SpanNearQuery with a slop of 0.

    Unfortunately there's no SpanWildcardQuery in Lucene.Net. Either you'll need to use SpanMultiTermQueryWrapper, or with little effort you can convert the java version to C#.

提交回复
热议问题