On 3/31/2018 10:22 AM, Elier Delgado wrote:
Hi, I'm working with facets in solr 7.2.1. Basically I'm following this
tutorial:
http://yonik.com/multi-select-faceting/
The following solr request works just fine:
&json.facet={domains:{type:terms,field:domains,domain:{excludeTags:DOMAIN}},specialties:{type:terms,field:specialties,domain:{excludeTags:SPECIALTY}}}
&fq={!tag=SPECIALTY}specialties:(1043 1023) AND {!tag=DOMAIN}domains:100
If I just change the order in the fq parameter, solr response with 400 Bad
Request.
&json.facet={domains:{type:terms,field:domains,domain:{excludeTags:DOMAIN}},specialties:{type:terms,field:specialties,domain:{excludeTags:SPECIALTY}}}
&fq={!tag=DOMAIN}domains:100 AND {!tag=SPECIALTY}specialties:(1043 1023)
I would like to know if I'm doing something wrong or it if could be a
problem in solr.
You've got {!tag} placed twice in one fq. I don't think you can do that
-- localparams (which is what that syntax is using) generally must be at
the very beginning of query text, and don't work when they're placed in
the middle.
Try this:
&fq={!tag=DOMAIN}domains:100&fq={!tag=SPECIALTY}specialties:(1043 1023)
The first request probably should have also thrown an error, and the
fact that it didn't MIGHT be a problem.
What is the full error, which should be many lines long? If you don't
see something that's lots of lines, look in solr.log.
Thanks,
Shawn