Hi, The fields are single valued. But, the requirement will be at query time rather than index time. This is because, we will be having many such scenarios with different fields. I hoped we could concatenate at query time. I just need top 100 counts from the leaf level of the pivot. I'm also looking at facet.threads which could give responses to an extent. But It does not solve my issue.
Hovewer, the Endeca equivalent of this application seems to be working well. Example Endeca Query: RETURN Results as SELECT Count(1) as "Total" GROUP BY "Country", "State", "part_num", "part_code" ORDER BY "Total" desc PAGE(0,100) -Lewin -----Original Message----- From: Alvaro Cabrerizo [mailto:topor...@gmail.com] Sent: Thursday, February 18, 2016 3:06 PM To: solr-user@lucene.apache.org Subject: Re: Hitting complex multilevel pivot queries in solr Hi, The idea of copying fields into a new one (or various) during indexing and then facet the new field (or fields) looks promising. More information about data will be helpful (for example if the fields:country, state.. are single or multivalued). For example if all of the fields are single valued, then the combination of country,state,part_num,part_code looks like a file path country/state/part_num/part_code and maybe (don't know your business rules), the solr.PathHierarchyTokenizerFactory <https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters> could be an option to research instead of facet pivoting. On the other hand, I don't think that the copy field <https://cwiki.apache.org/confluence/display/solr/Copying+Fields> feature can help you to build that auxiliary field. I think that configuring an updateRequestProcessorChain <https://wiki.apache.org/solr/UpdateRequestProcessor>and building your own UpdateRequestProcessorFactory to concat the country,state,part_num,part_code values can be better way. Hope it helps. On Thu, Feb 18, 2016 at 8:47 PM, Lewin Joy (TMS) <lewin....@toyota.com> wrote: > Still splitting my head over this one. > Let me know if anyone has any idea I could try. > > Or, is there a way to concatenate these 4 fields onto a dynamic field > and do a facet.field on top of this one? > > Thanks. Any idea is helpful to try. > > -Lewin > > -----Original Message----- > From: Lewin Joy (TMS) [mailto:lewin....@toyota.com] > Sent: Wednesday, February 17, 2016 4:29 PM > To: solr-user@lucene.apache.org > Subject: Hitting complex multilevel pivot queries in solr > > Hi, > > Is there an efficient way to hit solr for complex time consuming queries? > I have a requirement where I need to pivot on 4 fields. Two fields > contain facet values close to 50. And the other 2 fields have 5000 and 8000 > values. > Pivoting on the 4 fields would crash the server. > > Is there a better way to get the data? > > Example Query Params looks like this: > &facet.pivot=country,state,part_num,part_code > > Thanks, > Lewin > > > >