You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by David Miranda <da...@gmail.com> on 2013/09/17 12:54:35 UTC

Search in a specific ScoreDoc result

Hi,

I want to do a kind of 'facet search', that initial research in a field of
all documents in the Lucene index, and second search in other field of the
documents returned to the first research.

Currently I'm do the first research :

Query q = new QueryParser(Version.LUCENE_43, "label", analyzer
> ).parse(label);
> TopScoreDocCollector collector = TopScoreDocCollector.create(MAX_HITS,
> true);
> searcher.search(q, collector);
> ScoreDoc[] hits = collector.topDocs().scoreDocs;


Now I want to the the next search only in ScoreDoc object and in other
field? How can I do this? I searched and found something related to the
lucene filters, but does not seem to do what I want.

Thanks.

Re: Search in a specific ScoreDoc result

Posted by Erick Erickson <er...@gmail.com>.
Why not? You can use a standard query as a filter query
from the Solr side, so it's got to be possible in Lucene.
What about using filters doesn't seem to work for this case?

Best,
Erick


On Tue, Sep 17, 2013 at 6:54 AM, David Miranda <da...@gmail.com>wrote:

> Hi,
>
> I want to do a kind of 'facet search', that initial research in a field of
> all documents in the Lucene index, and second search in other field of the
> documents returned to the first research.
>
> Currently I'm do the first research :
>
> Query q = new QueryParser(Version.LUCENE_43, "label", analyzer
> > ).parse(label);
> > TopScoreDocCollector collector = TopScoreDocCollector.create(MAX_HITS,
> > true);
> > searcher.search(q, collector);
> > ScoreDoc[] hits = collector.topDocs().scoreDocs;
>
>
> Now I want to the the next search only in ScoreDoc object and in other
> field? How can I do this? I searched and found something related to the
> lucene filters, but does not seem to do what I want.
>
> Thanks.
>