Hi,
For proper results during searches, the recommendation is to use same analyzer
for indexing and querying. We can achieve this by passing the same analyzer,
which was used for indexing, to QueryParser to construct Lucene query and use
this query while searching the index.
The question is -
If you are building queries manually, bypassing analysis, you just
need to make sure that you know what you are doing. As a trivial
example, if you are indexing with an analyzer that downcases
everything then you need to pass lowercase terms to TermQuery.
You can still use an analyzer where appro
tting it how I can use the same analyzer during searches
is I am constructing queries manually.
Regards,
Rajesh
--- On Tue, 1/13/09, Ian Lea wrote:
> From: Ian Lea
> Subject: Re: Using analyzer while constructing Lucene queries
> To: java-user@lucene.apache.org, rajesh_para...@yahoo.co
ument as
> it is indexed with token "play".
>
> What I am not really getting it how I can use the same analyzer during
> searches is I am constructing queries manually.
>
> Regards,
> Rajesh
>
> --- On Tue, 1/13/09, Ian Lea wrote:
>
> > From: Ian Lea
>
I can use the same analyzer during
> searches is I am constructing queries manually.
>
> Regards,
> Rajesh
>
> --- On Tue, 1/13/09, Ian Lea wrote:
>
> > From: Ian Lea
> > Subject: Re: Using analyzer while constructing Lucene queries
> > To: java-user@lucene
: 2> Construct your queries by yourself, by using TermQuery,
: PhraseQuery etc. directly. There are no Analyzers used when
: choosing this option. You have to know what the effects of the
: Analyzer used during indexing had on the field you're searching
: and be sure you're doing something compati