I'm pretty sure that UN_TOKENIZED really bypasses analysis
entirely. so yes, it's a little confusing that you can specify an
analyzer but then pass a flag that says, in effect, "ignore the
analyzer I *said* I wanted to use".

So, in your example, you *are* running your query through
SimpleAnalyzer, but your text is NOT getting run
through the analyzer when it's indexed.

Luke is invaluable for seeing the effect of different analyzers.

The caution to use the same analyzer at index and query time is,
in my experience, simply good advice to follow until you are
familiar enough with how Lucene uses analyzers to keep from
getting really, really, really confused. Once you understand
when analyzers are used and how they effect the token
stream, you can use different ones when analyzing as opposed
to searching. But I've rarely found that I *wanted* to do that....

Best
Erick

On Jan 13, 2008 12:08 PM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> 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?
>
> I have tried this out. I used a SimpleAnalyzer for indexing with
> Field.Store.YES and Field.Index.UN_TOKENIZED. I can see with Luke that the
> field values are store unchanged, 1:1. OK.
>
> Now I did a search with Luke and depending on the used analyzer the Query
> returns results or not.
>
> 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?
>
> Or in other words:
>
> How can I search for fields stored with Field.Index.UN_TOKENIZED?
> Why do I need an analyzer for searching?
>
> Thank you.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to