lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "WritingDistributedSearchComponents" by BensonMargulies
Date Thu, 12 Apr 2012 14:52:23 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "WritingDistributedSearchComponents" page has been changed by BensonMargulies:
http://wiki.apache.org/solr/WritingDistributedSearchComponents?action=diff&rev1=12&rev2=13

            1. modifyRequest() can be used to refine other shard requests, instead of sending
a separate !ShardRequest.  See the [[http://lucene.apache.org/solr/api/org/apache/solr/handler/component/FacetComponent|FacetComponent]]
for an example.  This is likely best done by calling ResponseBuilder.addRequest() which will
then invoke the modifyRequest() method on each of the components.
            1. Components can also indicate the purpose of their request by using the ShardRequest.PURPOSE_*
fields.  When set, these fields can then be inspected by the other components to see if it
is a purpose they are interested in.
       1. While we have outgoing !ShardRequest instances
-           1. Submit the requests to the shards. The QT for these requests will be null (the
default) unless the original query, or one of the components, set the the ShardParams.SHARDS_QT
parameter to something else. There appears to be no way to use a custom URL for the shard
queries.
+           1. Submit the requests to the shards. The QT for these requests will be null (the
default) unless the original query, or one of the components, set the the ShardParams.SHARDS_QT
parameter to something else. The ShardParams.SHARD_URL passes along the original URL to the
shards.
            1. For each component, handle the responses
       1. For each component, call finishStage() 
  In this process, each !ShardRequest then goes off to it's Shard just as if it were a normal
request of that server.
@@ -37, +37 @@

  org.apache.solr.BaseDistributedSearchTestCase provides test support for distributed components.
It compares the results of distributed and non-distributed queries.
  
  = Classes to Know =
+ 
+ == QueryComponent ==
+ 
+ If you are writing a search component that you add to the standard list, rather than replacing
the usual suspects, you will need to work with the behavior of the core component: !QueryComponent.

+ 
+  1. in prepare(), !QueryComponent parses the query, storing all of the resulting information
in the ResponseBuilder.
+ 
+  2. In distributedProcess(), !QueryComponent forks down two different paths depending on
whether the query is grouped or not. For non-grouped queries, it performs two interactions
with the shards. The first sends the original query out, but with the field list trimmed down
to the document ID and the score. For a grouped query, an explanation is *to be written*.
+  
+  3. in handleResponses, for a regular query, the results are merged, and then !QueryComponent
sends out the second query, to retrieve the desired fields from the original FL. When these
responses return, the final results are packaged up into the !ResponseBuilder.
  
  == ResponseBuilder ==
  

Mime
View raw message