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 Thomas Seidl <re...@gmx.net> on 2015/07/10 13:20:13 UTC
Using edismax in a filter query
Hi all,
I was wondering if there's any way to use the Extended DisMax query
parser in an "fq" filter query?
The problem is that I have a "facet.query" with which I want to check
whether a certain set of keywords would have any results. But since the
normal query goes across multiple fields, I end up with something like this:
facet.query=(field1:search OR field2:search OR field3:search OR
field4:search) AND (field1:keys OR field2:keys OR field3:keys OR
field4:keys)
(Just with a lot more fields.) On the one hand this is rather ugly to
see in the logs, but mostly I'm concerned that this would be harder to
parse for Solr than using its own edismax parser to do the job.
So, is there a way to do that? Or are there any other alternatives to
achieve this (except sending a second query, of course)?
Since the fields used can change from request to request, it's not
possible to dump all their contents into a single field for that purpose.
Thanks in advance,
Thomas
Re: Using edismax in a filter query
Posted by Thomas Seidl <re...@gmx.net>.
Hi Ahmet,
Brilliant, thanks a lot!
I thought it might be possible with local parameters, but couldn't find
any information anywhere on how (especially setting the multi-valued
"qf" parameter).
Thanks again,
Thomas
On 2015-07-10 14:09, Ahmet Arslan wrote:
> Hi Tomasi
>
> Yes it is possible, please see local params :
> https://cwiki.apache.org/confluence/display/solr/Local+Parameters+in+Queries
>
> fq={!edismax qf='field1 field2 field'}search key
> Ahmet
>
>
> On Friday, July 10, 2015 2:20 PM, Thomas Seidl <re...@gmx.net> wrote:
>
>
>
> Hi all,
>
> I was wondering if there's any way to use the Extended DisMax query
> parser in an "fq" filter query?
> The problem is that I have a "facet.query" with which I want to check
> whether a certain set of keywords would have any results. But since the
> normal query goes across multiple fields, I end up with something like this:
>
> facet.query=(field1:search OR field2:search OR field3:search OR
> field4:search) AND (field1:keys OR field2:keys OR field3:keys OR
> field4:keys)
>
> (Just with a lot more fields.) On the one hand this is rather ugly to
> see in the logs, but mostly I'm concerned that this would be harder to
> parse for Solr than using its own edismax parser to do the job.
>
> So, is there a way to do that? Or are there any other alternatives to
> achieve this (except sending a second query, of course)?
> Since the fields used can change from request to request, it's not
> possible to dump all their contents into a single field for that purpose.
>
> Thanks in advance,
> Thomas
>
Re: Using edismax in a filter query
Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi Tomasi
Yes it is possible, please see local params :
https://cwiki.apache.org/confluence/display/solr/Local+Parameters+in+Queries
fq={!edismax qf='field1 field2 field'}search key
Ahmet
On Friday, July 10, 2015 2:20 PM, Thomas Seidl <re...@gmx.net> wrote:
Hi all,
I was wondering if there's any way to use the Extended DisMax query
parser in an "fq" filter query?
The problem is that I have a "facet.query" with which I want to check
whether a certain set of keywords would have any results. But since the
normal query goes across multiple fields, I end up with something like this:
facet.query=(field1:search OR field2:search OR field3:search OR
field4:search) AND (field1:keys OR field2:keys OR field3:keys OR
field4:keys)
(Just with a lot more fields.) On the one hand this is rather ugly to
see in the logs, but mostly I'm concerned that this would be harder to
parse for Solr than using its own edismax parser to do the job.
So, is there a way to do that? Or are there any other alternatives to
achieve this (except sending a second query, of course)?
Since the fields used can change from request to request, it's not
possible to dump all their contents into a single field for that purpose.
Thanks in advance,
Thomas