lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karthick Duraisamy Soundararaj (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SOLR-1093) A RequestHandler to run multiple queries in a batch
Date Thu, 16 Aug 2012 13:29:38 GMT

    [ https://issues.apache.org/jira/browse/SOLR-1093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13435940#comment-13435940
] 

Karthick Duraisamy Soundararaj edited comment on SOLR-1093 at 8/17/12 12:28 AM:
--------------------------------------------------------------------------------

I have created a new class MultiSearchHandler which is an extension of SearchHandler. It takes
all the parameters that a SearchHandler can take and parses them into sub queries(LocalSolrQueryRequests).
It then executes each of these sub queries serially using the SearchHandler. It doesnt enforce
IndexSearcher consistency amongnst multiple queries within the same request (This doesnt harm
us and is infact good for our usecase).

Usage 
    To pass a parameter an individual query, it should be prefixed with the query number
           Eg. 1.q=”query1”&2.q=”query2”….

    To pass a parameter to all queries, the prefix shouldn’t be specified
           Eg. count=2&query=”common_query”&1.mm=3&2.mm=2….

New query parameters specific to MultiSearchHandler
    In addition to all the parameters that a SearchHandler can accept, the following query
parameters can be passed to the MultiSearchHandler

    Query parameter that can be used both as common & specific  to each individual query
           threshold     - The minimum number of matches(numFound) for a query.    Default
value is -1 .    
    
    Query parameter common to all the sub queries
           count                -   Count of the queries in the url . This parameter is mandatory
           skiponfailure - Boolean parameter that specifies whether or not to include the
results of queries  whose numFound is less than threshold. This parameter is optional.
           stoponpass   -  Boolean parameter that specifies whether or not to stop executing
if the query if first subquery has result count greater than the threshold. This parameter
is optional.


                
      was (Author: d.s.karthick):
    I have created a new class MultiSearchHandler which is an extension of SearchHandler.
It takes all the parameters that a SearchHandler can take and parses them into sub queries(LocalSolrQueryRequests).
It then executes each of these sub queries serially using the SearchHandler. It doesnt enforce
IndexSearcher consistency amongnst multiple queries within the same request (This doesnt harm
us and is infact good for our usecase).

Usage 

To pass a parameter an individual query, it should be prefixed with the query number

           Eg. 1.q=”query1”&2.q=”query2”….

To pass a parameter to all queries, the prefix shouldn’t be specified

           Eg. count=2&query=”query1”&1.mm=3&2.mm=2….

 

New query parameters specific to MultiSearchHandler

In addition to all the parameters that a SearchHandler can accept, the following query parameters
can be passed to the MultiSearchHandler


Query parameter that can be used both as common & specific  to each individual query

threshold     - The minimum number of matches(numFound) for a query.    Default value is -1
.    


Query parameter common to all the sub queries

           count                -   Count of the queries in the url . This parameter is mandatory

skiponfailure - Boolean parameter that specifies whether or not to include the results of
queries  whose numFound is less than threshold. This parameter is optional.

stoponpass   -  Boolean parameter that specifies whether or not to stop executing if the query
if first subquery has result count greater than the threshold. This parameter is optional.


                  
> A RequestHandler to run multiple queries in a batch
> ---------------------------------------------------
>
>                 Key: SOLR-1093
>                 URL: https://issues.apache.org/jira/browse/SOLR-1093
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>            Reporter: Noble Paul
>            Assignee: Simon Willnauer
>             Fix For: 4.0
>
>         Attachments: SOLR-1093.patch
>
>
> It is a common requirement that a single page requires to fire multiple queries .In cases
where these queries are independent of each other. If there is a handler which can take in
multiple queries , run them in paralll and send the response as one big chunk it would be
useful
> Let us say the handler is  MultiRequestHandler
> {code}
> <requestHandler name="/multi" class="solr.MultiRequestHandler"/>
> {code}
> h2.Query Syntax
> The request must specify the no:of queries as count=n
> Each request parameter must be prefixed with a number which denotes the query index.optionally
,it may can also specify the handler name.
> example
> {code}
> /multi?count=2&1.handler=/select&1.q=a:b&2.handler=/select&2.q=a:c
> {code}
> default handler can be '/select' so the equivalent can be
> {code} 
> /multi?count=2&1.q=a:b&2.q=a:c
> {code}
> h2.The response
> The response will be a List<NamedList> where each NamedList will be a response
to a query. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message