Sunday, April 1, 2018

FW: Bad request from solr by just changing the order in the filter query

-----Original Message-----
From: Shawn Heisey [mailto:elyograg@elyograg.org]
Sent: 31 March 2018 22:16
To: solr-user@lucene.apache.org
Subject: Re: Bad request from solr by just changing the order in the filter
query

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:DOM
> AIN}},specialties:{type:terms,field:specialties,domain:{excludeTags:SP
> ECIALTY}}}
> &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:DOM
> AIN}},specialties:{type:terms,field:specialties,domain:{excludeTags:SP
> ECIALTY}}}
> &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

No comments:

Post a Comment