lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance Norskog (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (SOLR-2026) Need infrastructure support in Solr for requests that perform multiple sequential queries
Date Tue, 17 Aug 2010 02:51:17 GMT

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

Lance Norskog edited comment on SOLR-2026 at 8/16/10 10:49 PM:
---------------------------------------------------------------

About where in the stack this should occur: I can wanting to do 2 successive queries at each
shard, or doing one query against all shards, then a second query against shards.  These would
be implemented in different parts of the code stack, right?

      was (Author: lancenorskog):
    Here's a use case: field collapsing. Some people currently do field collapsing with 2
queries: first you get a few hundred documents with just the id and _collapsar_ field. Then
you trim the id set from the collapsar contents. and grab the first N unique ids. This is
fine when you don't really care how many docs are in each collapsar group, you only care that
there is more than one item per group.

This works great as a 2-query sequence where the code analyses the first return to create
the second query.


  
> Need infrastructure support in Solr for requests that perform multiple sequential queries
> -----------------------------------------------------------------------------------------
>
>                 Key: SOLR-2026
>                 URL: https://issues.apache.org/jira/browse/SOLR-2026
>             Project: Solr
>          Issue Type: New Feature
>          Components: SearchComponents - other
>            Reporter: Karl Wright
>            Assignee: Simon Willnauer
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: SOLR-2026.patch, SOLR-2026.patch
>
>
> Several known cases exist where multiple index searches need to be performed in order
to arrive at the final result.  Typically, these have the constraint that the results from
one search query are required in order to form a subsequent search query.  While it is possible
to write a custom QueryComponent or search handler to perform this task, an extension to the
SearchHandler base class would readily permit such query sequences to be configured using
solrconfig.xml.
> I will be therefore writing and attaching a patch tomorrow morning which supports this
extended functionality in a backwards-compatible manner.  The tricky part, which is figuring
out how to funnel the output of the previous search result into the next query, can be readily
achieved by use of the SolrRequestObject.getContext() functionality.  The stipulation will
therefore be that the SolrRequestObject's lifetime will be that of the entire request, which
makes complete sense.  (The SolrResponseObject's lifetime will, on the other hand, be limited
to a single query, and the last response so formed will be what gets actually returned by
SearchHandler.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message