1

I need union similar like sql below.

Select top 10 * from table1 order by name desc union Select top 5 * from table1 order by name asc

So the result should be a single list with 15 records. Is it possible to do this in single query in SOLR ?

I am using SOLR 5.3.1

Thanks and really appreciate your feedback.

  • Share your first query then I can try with the next one. Most probably we have to use group.query – Dibakar Paul Aug 12 '16 at 07:22
  • http://......?q=(*:* *:*)&rows=10&fq=_indexname:(sample_index)&sort=_name desc or _query_:{rows=5&fq=_indexname:(sample_index)&sort=_name asc}. I am trying to achieve using that query but doesn't get the correct result – Arif uzzaman Aug 12 '16 at 08:16
  • Try this, https://cwiki.apache.org/confluence/display/solr/Result+Grouping – Dibakar Paul Aug 12 '16 at 08:47
  • 1
    I really don't have any idea how to achieve union through grouping. Any real example can you send me? Another thing is, do you know if SOLR natively supports union or not? Thanks and really appreciate your feedback – Arif uzzaman Aug 16 '16 at 02:37

0 Answers0