Search code examples
solrwebsolr

Field collapsing / Grouping - How to make SOLR return intersection of 2 resultset groups?


I have 2 fields for grouping, these 2 field can have different keywords stored in them

Ex:

Field1: CD, book, e-book

Field2: repo1, repo2, repo3, repo4

Now I want to group the combination of CD/repo1 , book/repo2, e-book/repo3,e-book/repo4,CD/repo4 rather than grouping just on field1 seperately and field2 seperately. i.e I need to group based on 2 grouped results (intersection between the grouped results). Is there a way I can make SOLR return group results for all combination?

Thanks. BB


Solution

  • I don't think you can have intersection between grouped results at query time.
    The other solution would be create the combination into a field at index time and use the field for grouping which would give you the results.