lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Indexing lists of IDs
Date Wed, 14 Apr 2010 21:12:29 GMT
You can add the terms with Field.Index.NOT_ANALYZED multiple times to the same field. If you
use an analyzer like WhitespaceAnalyzer and you analyze your tersm, you must also pass the
analyzed term through analyzer when building a TermQuery. This may explain, why you don’t
get those IDs.

But for IDs in general, you should not use analyzers and add as NOT_ANYLYZED and query with
TermQuery. As explained before, just add more than one term to the same field.

Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen

> -----Original Message-----
> From: Kristjan Siimson []
> Sent: Wednesday, April 14, 2010 9:16 PM
> To:
> Subject: Indexing lists of IDs
> Hello,
> I have document for which I'd like to index an array of indexes. For
> example, there is a product that belongs to categories with IDs 12, 15,
> 16,
> 145, 148. I'd like to index these categories, and then be able to use
> them
> in queries, so that I can search for product which's name is "Bottle"
> and
> which belongs to category 12.
> I came up with creating a field in which I store the ID numbers and
> separate
> them with spaces. However, when I tried to create a term query, the
> query
> never gave any results. Can anybody help me with this?
> Sincerely,
> Kristjan Siimson

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message