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 "alessandro.benedetti" <a....@sease.io> on 2017/02/07 13:00:23 UTC
Distributed Search (across collections) + partial Filter query
Hi all,
*Scenario*
I run searches across different collections.
e.g.
we have 2 collections, 1 with a *field1* defined and 1 not.
*Use Case*
I would like to send a distributed request with a parameter that will filter
the results on field1 on the collection1 but do nothing with the
collection2.
Basically getting back :
Partial results from collection1(fq applied) and total results from
collection2 (no fq applied)
*Version*
4.10
out of the box collection2 will not be happy and raise a "field not defined"
exception.
If I was in Solr >5.1 I would have used macro expansion, passing a new
request parameter :
1) collection1 request handler would have used it to append a new filter
query
2) collection2 request handler would have discarded it doing nothing
Unfortunately in the Solr version I am , macro expansion was not there
yet.[1]
I will continue thinking on it but if you have any idea, let me know!
Cheers
[1] http://yonik.com/solr-query-parameter-substitution/
-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
View this message in context: http://lucene.472066.n3.nabble.com/Distributed-Search-across-collections-partial-Filter-query-tp4319166.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Distributed Search (across collections) + partial Filter query
Posted by "alessandro.benedetti" <a....@sease.io>.
Hi all,
thanks to Andrea Gazzarini suggestion I solved it using local params ( which
is different from macro expansion even if conceptually similar).
Local params were available in Solr 4.10.x
I appended this filter query in the request handler of interest:
<lst name="appends">
<str name="fq">{!lucene df=filterField v=$allowed_values}</str>
<str name="allowed_values">*</str>
</lst>
This will appear in all the collections request handler that want to use the
filter.
Cheers
-----
---------------
Alessandro Benedetti
Search Consultant, R&D Software Engineer, Director
Sease Ltd. - www.sease.io
--
View this message in context: http://lucene.472066.n3.nabble.com/Distributed-Search-across-collections-partial-Filter-query-tp4319166p4319292.html
Sent from the Solr - User mailing list archive at Nabble.com.