[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lucene-user
Subject:    Re: How to find "function()" - ?
From:       "Michael D. Curtin" <mike () curtin ! com>
Date:       2006-01-30 16:00:32
Message-ID: 43DE3820.8040208 () curtin ! com
[Download RAW message or body]

Dmitry Goldenberg wrote:

> a) if I index "function()" as "function()" rather than "function", does that mean \
> that if I search for "function", then it won't be found? -- the problem is that in \
> some cases, the user will want to find function(), and in some cases just function \
> -- can I accommodate for both?

The term "function" is different from the term "function()", so a 
literal search for one won't find the other.  Your Analyzer could emit 
two tokens for the input "function()":  "function" and "function()", at 
the same position (increment 0) if that's what you want.

> b) I understand about QueryParser.escape at searching time; at indexing time \
> though, do I still need to escape the indexed values, e.g. keyword values, and \
> store them in the escaped fashion, e.g. function\() -- or is function() ok?

Don't escape them at index time, only at search time.

Good luck!

--MDC

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic