Erik Hatcher wrote:


On Oct 20, 2004, at 9:55 AM, Aviran wrote:

AFIK if the term "Election 2004" will be between quotation marks this should
work fine.


No, it won't. The Analyzer will analyze it, and the WhitespaceAnalyzer would split it into two tokens [Election] and [2004].

This is a tricky situation with no clear *best* way to do this sort of thing. However, given what I've seen of this thread so far I'd recommend using the PerFieldAnalyzerWrapper and associate the fields indexed as Field.Keyword with a KeywordAnalyzer. There have been some variants of this posted on the list - it is not included in the API, however perhaps it should be. Or perhaps there are other options to solve this recurring dilemma folks have with Field.Keyword indexed fields and QueryParser?

    Erik

I still don't understand what is wrong with the Idea of indexing the title in a separate field and searching with a Phrase query
+title:"Elections 2004" ?
I think that the real problem is that the title is not tokenized and the title contains more then "Elections 2004"


I think it is worthing to give a try to this solution.

Or maybe I don't understand the problem correctly ...

All the best,

Sergiu








Aviran http://aviran.mordos.com

-----Original Message-----
From: Morus Walter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 20, 2004 2:25 AM
To: Lucene Users List
Subject: RE: Null or no analyzer


Aviran writes:

You can use WhiteSpaceAnalyzer

Can he? If "Elections 2004" is one token in the subject field (keyword),
this will fail, since WhiteSpeceAnalyzer will tokenize that to `Elections'
and `2004'.
So I guess he has to write an identity analyzer himself unless there is one
provided (which doesn't seem to be the case). The only alternatives are not
using query parser or extending query parser for a key word syntax, as far
as I can see.





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to