0
votes

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 both, but filename with "" ""

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

2 Answers

1
votes

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 :/

1
votes

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