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 Greenhorn Techie <gr...@gmail.com> on 2018/10/02 14:41:00 UTC

Multiple Queries per request

Hi,

We are building a mobile app which would display results from Solr. At the
moment, the idea is to have multiple widgets / areas on the mobile screen,
with each area being served by a distinct Solr query. For example first
widget would be display customer’s aggregated product usage, second widget
to display time-windows during which they are ore active on the app.

As these two widgets have different field list and query parameters, I was
wondering whether I can make a single call into Solr, which would then be
sending the results catering to each widget separately. I have gone through
the mail archive, but could not determine whether this is possible or not
an option in solr.

Any thoughts from the  awesome community?

Thanks

Re: Multiple Queries per request

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
You should not be exposing Solr publicly to the production client
unless you really, really know how to do security hardening. Normally,
treat it more like a database.

So, most of the cases, you would have an actual server app that talks
to Solr behind the scenes. That gives you more flexibility to
introduce whatever you need. Maybe even something like a graphQL
resolver :-)

Good luck,
   Alex.
On Tue, 2 Oct 2018 at 10:41, Greenhorn Techie <gr...@gmail.com> wrote:
>
> Hi,
>
> We are building a mobile app which would display results from Solr. At the
> moment, the idea is to have multiple widgets / areas on the mobile screen,
> with each area being served by a distinct Solr query. For example first
> widget would be display customer’s aggregated product usage, second widget
> to display time-windows during which they are ore active on the app.
>
> As these two widgets have different field list and query parameters, I was
> wondering whether I can make a single call into Solr, which would then be
> sending the results catering to each widget separately. I have gone through
> the mail archive, but could not determine whether this is possible or not
> an option in solr.
>
> Any thoughts from the  awesome community?
>
> Thanks

Re: Multiple Queries per request

Posted by Walter Underwood <wu...@wunderwood.org>.
Have a middle tier that does all the queries and returns combined results. Or do all the queries simultaneously, like AJAX.

I think it is still true with SolrJ that async, parallel queries to Solr are easy. Send each request, but don’t read the response. When you are done sending requests, start reading responses. Don’t worry about the order for reading responses. You won’t be done until the slowest one returns. It doesn’t make any difference whether you read the slowest one first or last, it is still the slowest.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Oct 2, 2018, at 8:11 AM, David Hastings <ha...@gmail.com> wrote:
> 
> perhaps you could do an OR query with the two requirements, and sort by an
> identifier that makes each result set unique from the other
> 
> On Tue, Oct 2, 2018 at 11:05 AM Greenhorn Techie <gr...@gmail.com>
> wrote:
> 
>> Shamik,
>> 
>> Wondering how to get this working? As I mentioned, my data is different for
>> each of the wizards. So not sure how to "return all the necessary data at
>> one shot and group them”
>> 
>> Any particular inputs?
>> 
>> Thanks
>> 
>> 
>> On 2 October 2018 at 15:47:50, Shamik Sinha (shamikchand001@gmail.com)
>> wrote:
>> 
>> The Solr uses REST based calls which is done over http or https which
>> cannot handle multiple requests at one shot. However what you can do is
>> return all the necessary data at one shot and group them according to your
>> needs.
>> Thanks and regards,
>> Shamik
>> 
>> 
>> On 02-Oct-2018 8:11 PM, "Greenhorn Techie" <gr...@gmail.com>
>> wrote:
>> 
>> Hi,
>> 
>> We are building a mobile app which would display results from Solr. At the
>> moment, the idea is to have multiple widgets / areas on the mobile screen,
>> with each area being served by a distinct Solr query. For example first
>> widget would be display customer’s aggregated product usage, second widget
>> to display time-windows during which they are ore active on the app.
>> 
>> As these two widgets have different field list and query parameters, I was
>> wondering whether I can make a single call into Solr, which would then be
>> sending the results catering to each widget separately. I have gone through
>> the mail archive, but could not determine whether this is possible or not
>> an option in solr.
>> 
>> Any thoughts from the awesome community?
>> 
>> Thanks
>> 


Re: Multiple Queries per request

Posted by David Hastings <ha...@gmail.com>.
perhaps you could do an OR query with the two requirements, and sort by an
identifier that makes each result set unique from the other

On Tue, Oct 2, 2018 at 11:05 AM Greenhorn Techie <gr...@gmail.com>
wrote:

> Shamik,
>
> Wondering how to get this working? As I mentioned, my data is different for
> each of the wizards. So not sure how to "return all the necessary data at
> one shot and group them”
>
> Any particular inputs?
>
> Thanks
>
>
> On 2 October 2018 at 15:47:50, Shamik Sinha (shamikchand001@gmail.com)
> wrote:
>
> The Solr uses REST based calls which is done over http or https which
> cannot handle multiple requests at one shot. However what you can do is
> return all the necessary data at one shot and group them according to your
> needs.
> Thanks and regards,
> Shamik
>
>
> On 02-Oct-2018 8:11 PM, "Greenhorn Techie" <gr...@gmail.com>
> wrote:
>
> Hi,
>
> We are building a mobile app which would display results from Solr. At the
> moment, the idea is to have multiple widgets / areas on the mobile screen,
> with each area being served by a distinct Solr query. For example first
> widget would be display customer’s aggregated product usage, second widget
> to display time-windows during which they are ore active on the app.
>
> As these two widgets have different field list and query parameters, I was
> wondering whether I can make a single call into Solr, which would then be
> sending the results catering to each widget separately. I have gone through
> the mail archive, but could not determine whether this is possible or not
> an option in solr.
>
> Any thoughts from the awesome community?
>
> Thanks
>

Re: Multiple Queries per request

Posted by Greenhorn Techie <gr...@gmail.com>.
Shamik,

Wondering how to get this working? As I mentioned, my data is different for
each of the wizards. So not sure how to "return all the necessary data at
one shot and group them”

Any particular inputs?

Thanks


On 2 October 2018 at 15:47:50, Shamik Sinha (shamikchand001@gmail.com)
wrote:

The Solr uses REST based calls which is done over http or https which
cannot handle multiple requests at one shot. However what you can do is
return all the necessary data at one shot and group them according to your
needs.
Thanks and regards,
Shamik


On 02-Oct-2018 8:11 PM, "Greenhorn Techie" <gr...@gmail.com>
wrote:

Hi,

We are building a mobile app which would display results from Solr. At the
moment, the idea is to have multiple widgets / areas on the mobile screen,
with each area being served by a distinct Solr query. For example first
widget would be display customer’s aggregated product usage, second widget
to display time-windows during which they are ore active on the app.

As these two widgets have different field list and query parameters, I was
wondering whether I can make a single call into Solr, which would then be
sending the results catering to each widget separately. I have gone through
the mail archive, but could not determine whether this is possible or not
an option in solr.

Any thoughts from the awesome community?

Thanks

Re: Multiple Queries per request

Posted by Shamik Sinha <sh...@gmail.com>.
The Solr uses REST based calls which is done over http or https which
cannot handle multiple requests at one shot. However what you can do is
return all the necessary data at one shot and group them according to your
needs.
Thanks and regards,
Shamik


On 02-Oct-2018 8:11 PM, "Greenhorn Techie" <gr...@gmail.com>
wrote:

Hi,

We are building a mobile app which would display results from Solr. At the
moment, the idea is to have multiple widgets / areas on the mobile screen,
with each area being served by a distinct Solr query. For example first
widget would be display customer’s aggregated product usage, second widget
to display time-windows during which they are ore active on the app.

As these two widgets have different field list and query parameters, I was
wondering whether I can make a single call into Solr, which would then be
sending the results catering to each widget separately. I have gone through
the mail archive, but could not determine whether this is possible or not
an option in solr.

Any thoughts from the  awesome community?

Thanks