lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: BlockGroupingCollector, not always getting first document
Date Thu, 08 Mar 2012 11:12:35 GMT
Hmm... that doesn't sound good.

Is the issue repeatable once it happens?  And, when it happens, can
you verify that the index is corrrect (eg, the missing doc is
retrievable by non-grouped searches)?  This way we can isolate the
issue to the search-side.

Can you boil it down to a small test case?

Mike McCandless

http://blog.mikemccandless.com

On Thu, Mar 8, 2012 at 4:30 AM, Grzegorz Tańczyk <goliatus@polzone.pl> wrote:
> Hello,
>
> I am using BlockGroupingCollector for first time and I have some small
> problem with it. Indexing code is pretty much copy of the one from docs.
> Searching looks like this:
>
>                Filter groupEndFilter = new CachingWrapperFilter(new
> QueryWrapperFilter(new TermQuery(new Term("last", "true"))));
> ...
>                BlockGroupingCollector c = new
> BlockGroupingCollector(SORT_SCORE, offset + n, false, groupEndFilter);
>                searcher.search(query, filter, c);
>                TopGroups groups = c.getTopGroups(SORT_ID, offset, 0, 1,
> true);
>                if (groups != null) {
>                    results.total_hits = groups.totalGroupCount.intValue();
>                    for (int i = 0; i < groups.groups.length; i++)
>                        if (groups.groups[i].totalHits > 0)
>                            results.add(getResult(searcher,
> groups.groups[i].scoreDocs[0]));
>                }
>
> So I want to get top groups for given query with documents sorted by their
> IDs. For some reason I don't always get first document from group. It's like
> every 10th group of search results does not have document with lowest ID on
> first position in scoreDocs.
> ID is numeric field. Sorting groups by field values works fine.
> Documents also are sorted by their IDs during indexing and I'm adding them
> as block.
>
> What am I doing wrong?
>
> --
> Regards,
>  Grzegorz

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message