On Jan 13, 2008, at 12:08 PM, <[EMAIL PROTECTED]> wrote:
I have some doubts about Analyzer usage. I read that one shall
always use
the same analyzer for searching and indexing.
Why? How does the Analyzer effect the search process? What is
analyzed here
again?
As you surmised, it is because QueryParser analyzes fragments of the
query string in order to get the query to match the terms indexed.
I can see that when I use the SimpleAnalyzer again, the values of
my search
are all converted to lowercase and numbers are removed.
This leads to wrong results, because my values are stored with
Field.Index.UN_TOKENIZED.
Why is my query changed this way?
I think it has to do with QueryParsing, which uses an analyzer. Right?
Can I create a query directly, without parsing?
Yes, there are many Query subclasses in Lucene that you can use
directly.
Or in other words:
How can I search for fields stored with Field.Index.UN_TOKENIZED?
Use TermQuery.
Why do I need an analyzer for searching?
Consider a full-text field that will be tokenized removing special
characters and lowercased, and then a user querying for an uppercase
word. The main thing is that queries need to jive with how things
got indexed, Analyzer in the mix or not.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]