开发者

lucene.net problem with wildcard "*"

开发者 https://www.devze.com 2022-12-17 07:23 出处:网络
hello i have a question to lucene searching syntax the \"\" is a wildcard. when i searchte: i find test ,...

hello i have a question to lucene searching syntax

the "" is a wildcard. when i search te : i find test ,... but when i search *st i don't find "test :> whats the issue?

and i have a search concerning the text and an other search concerning the filename

in the filename search i use ""+searchstring "" in the textsearch just "searchstring"

what can i do when i search bo开发者_高级运维th, but filename with "" ""

parser = New MultiFieldQueryParser(New [String]() {"title", "bodytext"}, New StandardAnalyzer())


hmm http://lucene.apache.org/java/2_3_2/queryparsersyntax.html#Wildcard%20Searches -->Note: You cannot use a * or ? symbol as the first character of a search.

well i think that's it :/


The default setting in the QueryParser is to not allow leading wildcards.

You can alter this with setting property on the QueryParser - SetAllowLeadingWildcard(true);

Be aware though the performance can take a major tumble since you potentially open up a huge number of hits with this kind of wildcard search.

Roger

0

精彩评论

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