You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Venkateshprasanna <pr...@yahoo.co.in> on 2006/09/07 05:51:57 UTC
Re: Atomic index/search for a phrase
Which is more efficient with respect to performance?
Indexing a phrase as it is and searcing with the help of a TermQuery
OR
Storing only single words in index and making use of quoted search
phrases?
Regards,
Venkateshprasanna
If you index "A Phrase" as untokenized, you would find it with a
TermQuery for "A Phrase". You must use exact case. If you're using
QueryParser, the text get analyzed and most analyzers lowercase. If
this expression is quoted it would become a PhraseQuery with two
terms, or if it is unquoted it would become a BooleanQuery with two
TermQuery clauses - either way it would not match if you indexed the
phrase as untokenized.
--
View this message in context: http://www.nabble.com/Atomic-index-search-for-a-phrase-tf1250772.html#a6183788
Sent from the Lucene - Java Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Atomic index/search for a phrase
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
A single TermQuery is surely the fastest query of all. But, what
are you really trying to do? It is not generally useful to index
things untokenized except for precise key-like fields but not for
full-text ones.
Erik
On Sep 6, 2006, at 11:51 PM, Venkateshprasanna wrote:
>
> Which is more efficient with respect to performance?
> Indexing a phrase as it is and searcing with the help of a
> TermQuery
> OR
> Storing only single words in index and making use of quoted
> search
> phrases?
>
> Regards,
> Venkateshprasanna
>
> If you index "A Phrase" as untokenized, you would find it with a
> TermQuery for "A Phrase". You must use exact case. If you're using
> QueryParser, the text get analyzed and most analyzers lowercase. If
> this expression is quoted it would become a PhraseQuery with two
> terms, or if it is unquoted it would become a BooleanQuery with two
> TermQuery clauses - either way it would not match if you indexed the
> phrase as untokenized.
>
>
> --
> View this message in context: http://www.nabble.com/Atomic-index-
> search-for-a-phrase-tf1250772.html#a6183788
> Sent from the Lucene - Java Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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