lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Ohrt <julian.o...@aploris.com>
Subject TermDistinctValuesCollector
Date Tue, 08 Nov 2016 07:43:19 GMT
Hi:

I am trying to use the class TermDistinctValuesCollector from Core namespace Lucene.Net.Search.Grouping.
Studying http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/search/grouping/term/TermDistinctValuesCollector.html
I found a short explanation for the three parameters of the constructor:

groupField - The field to group by
countField - The field to count distinct values for
groups - The top N groups, collected during the first phase search

I am still not sure what the group is (is it the field for which the content is counted?),
why a lucene field is needed for counting, and what the "first phase search" is.
I tried something like this:

Collection<GroupCount> groups = new Collection<GroupCount>();
TermDistinctValuesCollector collector = new TermDistinctValuesCollector("groupField", "countField",
groups);
mIndexSearcher.Search(query, null, collector);

Of course to no avail. Groups is empty. It did give me any result at all.

Is there any documentation I missed? I did not even find any second hit for "TermDistinctValuesCollector"
in the lucenenet repository except for TermDistinctValuesCollector.cs itself. Not even a unit
test.

A short example how to use it would be awesome. But I'd also like to understand how it works
(should work) internally. What are member variables ordSet, groupFieldTermIndex, etc. used
for? Not knowing the internals of lucene I just don't understand the source code.

Thanks a lot!
Julian



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