You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Rui António da Cruz Pereira <ru...@gmail.com> on 2009/03/12 16:50:10 UTC

Solr 1.4: filter documens using fields

Hi all!
I'm using StandardRequestHandler and I wanted to filter results by two 
fields in order to avoid duplicate results (in this case the documents 
are very similar, with differences in fields that are not returned in a 
query response).
For example, considering the response:

<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3142</long>
    <str name="topologyname">Locais</str>
</doc>
<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3141</long>
    <str name="topologyname">inventario</str>
</doc>
<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3141</long>
    <str name="topologyname">inventario</str>
</doc>
<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3140</long>
    <str name="topologyname">CPE</str>
</doc>
<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3140</long>
    <str name="topologyname">CPE</str>
</doc>

I wanted to filter by: instancekey and topologyid in order to get the 
following response:
<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3142</long>
    <str name="topologyname">Locais</str>
</doc>
<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3141</long>
    <str name="topologyname">inventario</str>
</doc>
<doc>
    <long name="instancekey">285</long>
    <str name="instancename">186_Testing</str>
    <long name="topologyid">3140</long>
    <str name="topologyname">CPE</str>
</doc>

I'm manage to do the filtering in the client, but then the paging 
doesn't work as it should (some pages may contain more duplicated 
results than others).
Is there a way (query or other RequestHandler) to do this?

Thanks,
    Rui Pereira

Re: Solr 1.4: filter documens using fields

Posted by Chris Hostetter <ho...@fucit.org>.
: I'm using StandardRequestHandler and I wanted to filter results by two fields
: in order to avoid duplicate results (in this case the documents are very
: similar, with differences in fields that are not returned in a query
: response).
	...
: I'm manage to do the filtering in the client, but then the paging doesn't work
: as it should (some pages may contain more duplicated results than others).
: Is there a way (query or other RequestHandler) to do this?

not at the moment, but some people have been working on trying to solve 
the broader problem in an efficient way...

https://issues.apache.org/jira/browse/SOLR-236



-Hoss