Hi Yonik, I will try the JSON Facet API and update here but my hunch is that querying mechanism is not the problem. Rather the problem lies with the solr aggregations.
Thanks On Tue, Dec 12, 2017 at 6:31 AM, Yonik Seeley <ysee...@gmail.com> wrote: > I think the SolrJ below uses the old stats component. > Hopefully the JSON Facet API would be faster for this, but it's not > completely clear what the main query here looks like, and if it's the > source of any bottleneck rather than the aggregations. > What does the generated query string actually look like (it may be > easiest just to pull this from the logs). > > -Yonik > > > On Mon, Dec 11, 2017 at 7:32 PM, RAUNAK AGRAWAL > <agrawal.rau...@gmail.com> wrote: > > Hi, > > > > We have a use case where there are 4-5 dimensions and around 3500 metrics > > in a single document. We have indexed only 2 dimensions and made all the > > metrics as doc_values so that we can run the aggregation queries. > > > > We have 6 million such documents and we are using solr cloud(6.6) on a 6 > > node cluster with 8 Vcores and 24 GB RAM each. > > > > On the same set of hardware in elastic search we were getting the > response > > in about 10ms whereas in solr we are getting response in around 300-400 > ms. > > > > This is how I am querying the data. > > > > private SolrQuery buildQuery(Integer variable1, List<Integer> groups, > > List<String> metrics) { > > SolrQuery query = new SolrQuery(); > > String groupQuery = " (" + groups.stream().map(g -> "group:" + > g).collect > > (Collectors.joining(" OR ")) + ")"; > > String finalQuery = "variable1:" + variable1 + " AND " + groupQuery; > > query.set("q", finalQuery); > > query.setRows(0); > > metrics.forEach( > > metric -> query.setGetFieldStatistics("{!sum=true }" + > metric) > > ); > > return query; > > } > > > > Any help will be appreciated regarding this. > > > > > > Thanks, > > > > Raunak >