lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Konopinsky <>
Subject Limiting Term Queries
Date Tue, 20 Jul 2004 20:27:28 GMT
Is it possible to limit a term query?

For example: I am indexing documents with (amongst other things)  a
string in one field and with a number in another field. All combinations
of strings and numbers are allowed and neither field is unique. I would
like a way to query Lucene to pull out all unique numbers for a specific

If I had: (a, 123) (b, 123) (a, 123) (b, 23) (a, 45)
I would want a way to pull all unqiue numbers such that the string is
- (a, 123) (a, 45)

Right now I am determining the unique numbers by performing a term
query: TermEnum enumerator = reader.terms(new Term(number_field, ""));

where reader is an IndexReader and number_field is the field containing
the number. This gives me a list of all unique numbers, but counts those
documents that might have different letters (i.e. not just 'a').

Any thoughts on this?


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

View raw message