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 Steven White <sw...@gmail.com> on 2015/11/21 17:29:59 UTC
Appending to user's query
Hi everyone,
I have a dozen of different edismax request handlers in my solrconfig.xml
file where each customize for different uses. They all have pre-defined fq
and qf to name some. Here is an example of one such handler:
<!-- English domain -->
"/select_sales_en":{
"class":"solr.SearchHandler",
"name":"/select_sales_en",
"defaults":{
"defType":"edismax",
"echoParams":"explicit",
"fl":"UniqueField,score",
"fq":"TypesList:(CA OR WA)",
"qf":"AllSales",
"rows":"10",
"wt":"xml"}},
<!-- Spanish domain -->
"/select_sales_es":{
"class":"solr.SearchHandler",
"name":"/select_sales_es",
"defaults":{
"defType":"edismax",
"echoParams":"explicit",
"fl":"UniqueField,score",
"fq":"TypesList:(CA OR WA OR TX OR FL)",
"qf":"AllSales",
"tie":"1.0",
"wt":"xml"}},
In some of the request handlers, I have a need to AND to the request a
customized search string such as "AND (Language:Spanish OR
Language:Chinese)" or "AND (Language:German)" for example to always be part
of the search no matter what the caller provides. The issue I'm having is
that If I put this text as part of my "fq" in that request handler such as:
"/select_sales_en":{
"class":"solr.SearchHandler",
"name":"/select_sales_en",
"defaults":{
"defType":"edismax",
"echoParams":"explicit",
"fl":"UniqueField,score",
>>> "fq":"TypesList:(CA OR WA) AND (Language:English)", <<<
"qf":"AllSales",
"rows":"10",
"wt":"xml"}},
It is getting replaced by the "fq" that the caller has the option to pass.
So, is there a way to force a search string to always be append to the
final search string before being passed on to Lucene?
I'm using Solr 5.2
Thanks in advanced
Steve
Re: Appending to user's query
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
appends ?
https://cwiki.apache.org/confluence/display/solr/RequestHandlers+and+SearchComponents+in+SolrConfig#RequestHandlersandSearchComponentsinSolrConfig-SearchHandlers
On Sat, Nov 21, 2015 at 7:29 PM, Steven White <sw...@gmail.com> wrote:
> Hi everyone,
>
> I have a dozen of different edismax request handlers in my solrconfig.xml
> file where each customize for different uses. They all have pre-defined fq
> and qf to name some. Here is an example of one such handler:
>
> <!-- English domain -->
> "/select_sales_en":{
> "class":"solr.SearchHandler",
> "name":"/select_sales_en",
> "defaults":{
> "defType":"edismax",
> "echoParams":"explicit",
> "fl":"UniqueField,score",
> "fq":"TypesList:(CA OR WA)",
> "qf":"AllSales",
> "rows":"10",
> "wt":"xml"}},
>
> <!-- Spanish domain -->
> "/select_sales_es":{
> "class":"solr.SearchHandler",
> "name":"/select_sales_es",
> "defaults":{
> "defType":"edismax",
> "echoParams":"explicit",
> "fl":"UniqueField,score",
> "fq":"TypesList:(CA OR WA OR TX OR FL)",
> "qf":"AllSales",
> "tie":"1.0",
> "wt":"xml"}},
>
> In some of the request handlers, I have a need to AND to the request a
> customized search string such as "AND (Language:Spanish OR
> Language:Chinese)" or "AND (Language:German)" for example to always be part
> of the search no matter what the caller provides. The issue I'm having is
> that If I put this text as part of my "fq" in that request handler such as:
>
> "/select_sales_en":{
> "class":"solr.SearchHandler",
> "name":"/select_sales_en",
> "defaults":{
> "defType":"edismax",
> "echoParams":"explicit",
> "fl":"UniqueField,score",
> >>> "fq":"TypesList:(CA OR WA) AND (Language:English)", <<<
> "qf":"AllSales",
> "rows":"10",
> "wt":"xml"}},
>
> It is getting replaced by the "fq" that the caller has the option to pass.
> So, is there a way to force a search string to always be append to the
> final search string before being passed on to Lucene?
>
> I'm using Solr 5.2
>
> Thanks in advanced
>
> Steve
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>