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 Baloo <as...@gmail.com> on 2017/02/27 08:38:02 UTC

Query construction in custom Solr component plugin

Hi, 

I have developed a solr component which expands users query and adds
additional clauses to the query. For this expansion we are making request to
external REST api's. This query expansion logic is mainly in prepare()
method. Everything works as expected in standalone mode. When we deploy this
plugin in SolrCloud environment each shard is calling external REST api for
query expansion. 

My question is that can we make only one call to external REST api since its
the same request sent from each shard to external service. How can we modify
our component to make only one call per search request ?



--
View this message in context: http://lucene.472066.n3.nabble.com/Query-construction-in-custom-Solr-component-plugin-tp4322403.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query construction in custom Solr component plugin

Posted by Erick Erickson <er...@gmail.com>.
Look for a couple of parameters, FROMLEADER and/or distrib=false.
Not quite sure which one you need though. When
a request comes in to the "aggregator" (just the first node in the cluster
that the request lands on) it sends out sub-requests to one replica in each
shard. These have to be marked do they in turn aren't sent out to other
replicas and I'm pretty sure one or both of those parameters will be set
on the sub-requests.

Best,
Erick

On Mon, Feb 27, 2017 at 12:38 AM, Baloo <as...@gmail.com> wrote:
> Hi,
>
> I have developed a solr component which expands users query and adds
> additional clauses to the query. For this expansion we are making request to
> external REST api's. This query expansion logic is mainly in prepare()
> method. Everything works as expected in standalone mode. When we deploy this
> plugin in SolrCloud environment each shard is calling external REST api for
> query expansion.
>
> My question is that can we make only one call to external REST api since its
> the same request sent from each shard to external service. How can we modify
> our component to make only one call per search request ?
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Query-construction-in-custom-Solr-component-plugin-tp4322403.html
> Sent from the Solr - User mailing list archive at Nabble.com.