lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rui António da Cruz Pereira <ruipereira...@gmail.com>
Subject Solr 1.4: filter documens using fields
Date Thu, 12 Mar 2009 15:50:10 GMT
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

Mime
View raw message