lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Rubin" <andre.ru...@gmail.com>
Subject Re: MultiPhrase search
Date Mon, 25 Aug 2008 23:44:07 GMT
For some reason, the TermQuery is not returning any results, even when
querying for a single word (like on*).

query = new TermQuery(new Term(LABEL_FIELD, searchString));

On 8/25/08, Daniel Naber <lucenelist2007@danielnaber.de> wrote:
> On Montag, 25. August 2008, Andre Rubin wrote:
>
>>  I tried it out but with no luck (I think I did it wrong). In any
>> case, is MultiPhraseQuery what I'm looking for? If it is, how should I
>> use the MultiPhraseQuery class?
>
> No, you won't need it. If you know that the field is not really tokenized
> (no matter whether by using UN_TOKENIZED or KeywordAnalyzer) you should
> create a TermQuery directly, without using the QueryParser. The
> QueryParser interprets AND, OR, and NOT, and a space is just a default
> for "OR", so using KeywordAnalyzer won't have the desired effect.
>
> Regards
>  Daniel
>
> --
> http://www.danielnaber.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message