> Don't mean to hijack this thread, but I have a related question: > > Is there also a way to filter the terms based on another field? > > For example, the documents might also contain the field "published > date", so I want to get a distinct list of values for the term > "religion" in documents published within a range of dates.
This is not covered by the TermEnum and cannot be retrieved easily. If you really need such functionality, you can e.g. use payloads. So index the religion as a term and attach the dates as a binary payload. Then you can enumerate over all religions like mentioned before, but filter the terms using the TermPositions access methods. It may also be possible the other way round (index dates and attach religion as payload). Uwe --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org