开发者

How do i search 'and' with lucene?

I am looking at the query syntax. and i could not figure out how to search 'and'. I tried "a sentence with and and words after it" i trie开发者_StackOverflow社区d +and and \and. It always ignored it. How can i search 'and'? I am using lucene.net


Are you including 'and' in the index so its searchable?

If your using the StandardAnalyzer to index your documents, 'and' is included in the default stop words list. You can pass your own list of stop words as a string array to the constructor of the StandardAnalyzer if you want to include the word 'and' in the index.


Have you tried AND in all caps?

If you want to do an AND search, you have a couple options. You can do

+foo +bar

or

foo AND bar

but

foo and bar

will not work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜