lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lu <>
Subject Re: Optimal Solution for Unique Field Values
Date Sun, 15 Feb 2009 13:14:04 GMT
I think you would need to
1) collect all the matching IDs for Field2=x
2) loop through Field1, for each Term's doc, collect the term if the term
doc is in the matching IDs from step 1.

This should be the fastest approach, pretty similar to what you suggested.

Chris Lu
Instant Scalable Full-Text Search On Any Database/Application
Lucene Database Search in 3 minutes:
DBSight customer, a shopping comparison site, (anonymous per request) got
2.6 Million Euro funding!

On Sun, Feb 15, 2009 at 5:02 AM, Joel Halbert <> wrote:

> Hi,
> I'm looking for an optimal solution for extracting unique field values.
> The rub is that I want to be able to perform this for a unique subset of
> per the example:
> I have an index with Field1 and Field2.
> I want "all unique values of Field1 where Field2=X".
> Other than actually performing a query, where I select all documents
> that satisfy the condition Field2=x and then collecting the unique field
> values myself by iterating across the hits, is there a way of leveraging
> the indexreader, and enumerating across Fields, something like the
> general example given here:
> Thx,
> Joel
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message