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 Dallan Quass <da...@quass.org> on 2009/04/04 03:14:52 UTC

How to send a parsed Query to shards?

I want to use distributed search with some search components that I would
like to execute only on the main server, not on the shards, because they
reference some large in-memory lookup tables.  After the search components
get done processing the orignal query, the query may contain SpanNearQueries
and DisjunctionMaxQueries.  I'd like to send that query to the shards, not
the original query.  

I've come up with the following idea for doing this.  Would people please
comment on this idea or suggest a better alternative?

* Subclass QueryComponent to base64 encode the serialized form of the query
and send that in place of the original query.

* set the queryParser on the shard servers to a custom class that unencodes
and deserializes the encoded query and returns it.

Thoughts on this approach, or is there a better one?

Thanks,

-dallan


Re: How to send a parsed Query to shards?

Posted by Chris Hostetter <ho...@fucit.org>.
: reference some large in-memory lookup tables.  After the search components
: get done processing the orignal query, the query may contain SpanNearQueries
: and DisjunctionMaxQueries.  I'd like to send that query to the shards, not
: the original query.  
: 
: I've come up with the following idea for doing this.  Would people please
: comment on this idea or suggest a better alternative?
: 
: * Subclass QueryComponent to base64 encode the serialized form of the query
: and send that in place of the original query.
: 
: * set the queryParser on the shard servers to a custom class that unencodes
: and deserializes the encoded query and returns it.

those are essentially the same idea .... a query string is just a 
simple form of QUery serialization.  a COmponent on your master could 
modify the query string to be anything you want (base64 encoded native 
serialization, xml based serialization, json, etc...) as long as the 
QParser on the slave machines know how to make sense of it.



-Hoss