lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Black <bl...@apple.com>
Subject Newbie: PerFieldAnalyzerWrapper or Build a dynamic BooleanQuery
Date Sun, 08 Feb 2004 16:13:03 GMT
I'm having difficulty understanding a couple of things and I appreciate 
any help here.

Let's assume I have an object that is composed of the following 
fields...

UID:  434      (Keyword/Stored)
TITLE:  "Java For Dum Dums"   (Text/Stored)
AUTHOR:  "Fred Smith"      -  Text/Stored
DESCRIPTION: "This would be a big long field"   - Text/Unstored
CONTEXT: "/Resources/Books/Computers & Technology/Languages/Java"   - 
Keyword

In order to let my code handle the dynamic definition of fields, I've 
been using the MuliFieldQueryParser and have had lots of trouble with 
the UID field.

I experimented with this thoroughly and discovered that using the word 
"dog"  as a UID works but "a1", "1", etc  doesn't.  It appears that an 
"untokenized" field is still analyzed for "real" words so my "UID" 
field which contains a code seems to get treated differently during 
indexing and searching.  I'm I nuts?

Another experiment showed me that a Term query during the search seems 
to work fine.  Hmmm.

Here's My Questions.....

1. Is the PerFieldAnalyzerWrapper the answer to this and if so, how do 
I use it?

2. Or would it be better for me to explicitly create a TermQuery for my 
UID and add it to a boolean query with the MutliFieldQueryParser output 
of the other fields?

3. Why would a field that was analyzed during indexing not be 
retrievable during search with the same analyzer.


A HUGE THANKS IN ADVANCE TO ANYONE WHO CAN HELP ME UNDERSTAND / ANSWER 
THIS.


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


Mime
View raw message