DisMaxHandler and plone advanced searches

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

DisMaxHandler and plone advanced searches

Leonardo Santagada
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



Reply | Threaded
Open this post in threaded view
|

Re: DisMaxHandler and plone advanced searches

Mike Klaas
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
Reply | Threaded
Open this post in threaded view
|

Re: DisMaxHandler and plone advanced searches

Leonardo Santagada

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



Reply | Threaded
Open this post in threaded view
|

Re: DisMaxHandler and plone advanced searches

Mike Klaas-2

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
Reply | Threaded
Open this post in threaded view
|

Re: DisMaxHandler and plone advanced searches

Leonardo Santagada

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



Reply | Threaded
Open this post in threaded view
|

Re: DisMaxHandler and plone advanced searches

Mike Klaas
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
Reply | Threaded
Open this post in threaded view
|

Re: DisMaxHandler and plone advanced searches

Leonardo Santagada

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