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 Leonardo Santagada <sa...@gmail.com> on 2008/02/13 15:16:00 UTC

DisMaxHandler and plone advanced searches

We would like to use DisMaxHandler but the thing is that on plone  
advanced search you can search for other fields besides the default  
one, and in more than one at the same time. So what would be nice is  
to be able to search with multiple "q" each with a specific field. Is  
this somehow possible or not?

[]'s
--
Leonardo Santagada




Re: DisMaxHandler and plone advanced searches

Posted by Leonardo Santagada <sa...@gmail.com>.
On 14/02/2008, at 00:58, Mike Klaas wrote:
> On 13-Feb-08, at 6:11 PM, Leonardo Santagada wrote:
>> On 13/02/2008, at 23:03, Mike Klaas wrote:
>>>> Try using standardrequesthandler with the dismax query parser.
>>
>>
>> How can I say to standardrequesthandler to apply each query string  
>> to a diferent field, and how can I conbine the two on the config  
>> xml? A little example would be cool.
>
> I don't see how you could pre-configure this in solrconfig.xml: how  
> do you specific which querystring gets sent to which field?
>
> Just send the query to stdreq handler as follows:
>
> q=field1:<query1> field2:<query2>
>
> see http://wiki.apache.org/solr/SolrQuerySyntax


Yes, that is what we are doing now, but <query1> and <query2> use the  
full lucene sintax and not the one from dismax query parser. I would  
like to be able to do a search like the one above but with the dismax  
query parser for <query1> ans <query2>. Is that possible in any way?

--
Leonardo Santagada




Re: DisMaxHandler and plone advanced searches

Posted by Mike Klaas <mi...@gmail.com>.
On 13-Feb-08, at 6:11 PM, Leonardo Santagada wrote:

>
> On 13/02/2008, at 23:03, Mike Klaas wrote:
>
>>
>> On 13-Feb-08, at 4:18 PM, Leonardo Santagada wrote:
>>>
>>> Thanks but I would like to be able to:
>>>
>>> q=<query>
>>> qf=field1
>>> q=<query2>
>>> qf=field2
>>> ...
>>>
>> Try using standardrequesthandler with the dismax query parser.
>
>
> How can I say to standardrequesthandler to apply each query string  
> to a diferent field, and how can I conbine the two on the config  
> xml? A little example would be cool.

I don't see how you could pre-configure this in solrconfig.xml: how  
do you specific which querystring gets sent to which field?

Just send the query to stdreq handler as follows:

q=field1:<query1> field2:<query2>

see http://wiki.apache.org/solr/SolrQuerySyntax

-Mike

Re: DisMaxHandler and plone advanced searches

Posted by Leonardo Santagada <sa...@gmail.com>.
On 13/02/2008, at 23:03, Mike Klaas wrote:

>
> On 13-Feb-08, at 4:18 PM, Leonardo Santagada wrote:
>>
>> Thanks but I would like to be able to:
>>
>> q=<query>
>> qf=field1
>> q=<query2>
>> qf=field2
>> ...
>>
> Try using standardrequesthandler with the dismax query parser.


How can I say to standardrequesthandler to apply each query string to  
a diferent field, and how can I conbine the two on the config xml? A  
little example would be cool.

--
Leonardo Santagada




Re: DisMaxHandler and plone advanced searches

Posted by Mike Klaas <kl...@worio.com>.
On 13-Feb-08, at 4:18 PM, Leonardo Santagada wrote:
>
> Thanks but I would like to be able to:
>
> q=<query>
> qf=field1
> q=<query2>
> qf=field2
> ...
>
> so I can use dismax facilities (that is, not having that many  
> wildcards and special characters) and search in more than one field  
> (but with different queries) at the same time.
>
> In this search form you have 3 places where you can choose a field  
> and then enter a search query... and then there are some more  
> restrictions you can choose (we would put those in one of more fq).  
> Get the idea?

Try using standardrequesthandler with the dismax query parser.

-Mike

Re: DisMaxHandler and plone advanced searches

Posted by Leonardo Santagada <sa...@gmail.com>.
On 13/02/2008, at 20:56, Mike Klaas wrote:

> On 13-Feb-08, at 6:16 AM, Leonardo Santagada wrote:
>
>> We would like to use DisMaxHandler but the thing is that on plone  
>> advanced search you can search for other fields besides the default  
>> one, and in more than one at the same time. So what would be nice  
>> is to be able to search with multiple "q" each with a specific  
>> field. Is this somehow possible or not?
>
> If you want to search the same thing in multiple fields, use:
>
> q=<query>
> qf=field1 field2 field3
>
> To this you can add multiple restrictions (filters) of arbitrary  
> queries in any field:
>
> fq=field4:query2
> fq=field5:query3
>
> If you want to boost these queries rather than filter, use bq.
>
> -Mike

Thanks but I would like to be able to:

q=<query>
qf=field1
q=<query2>
qf=field2
...

so I can use dismax facilities (that is, not having that many  
wildcards and special characters) and search in more than one field  
(but with different queries) at the same time.

In this search form you have 3 places where you can choose a field and  
then enter a search query... and then there are some more restrictions  
you can choose (we would put those in one of more fq). Get the idea?

--
Leonardo Santagada




Re: DisMaxHandler and plone advanced searches

Posted by Mike Klaas <mi...@gmail.com>.
On 13-Feb-08, at 6:16 AM, Leonardo Santagada wrote:

> We would like to use DisMaxHandler but the thing is that on plone  
> advanced search you can search for other fields besides the default  
> one, and in more than one at the same time. So what would be nice  
> is to be able to search with multiple "q" each with a specific  
> field. Is this somehow possible or not?

If you want to search the same thing in multiple fields, use:

q=<query>
qf=field1 field2 field3

To this you can add multiple restrictions (filters) of arbitrary  
queries in any field:

fq=field4:query2
fq=field5:query3

If you want to boost these queries rather than filter, use bq.

-Mike