I have seen documentation mentioning Sitecore.ContentSearch.SolrNetExtension
for Sitecore 9 indicating that its able to group results by a field (ie: _group
field). What I am unable to find is a nice and easy way to do this in Sitecore 8. What I had hoped to achieve was to simply append
fq=group=true&group.field=_group&group.main=true
to the query as a FilterQuery
. What I have tried thus far has been creating a custom QueryNode
called GroupByField(keySelector)
to inject a custom SolrQuery
into the SolrQueryMapperState.FilterQuery
with no luck. I have also tried to use the
.Filter(x => x["group"] == "true" && x["group.field"] ==
BuildInFields.Group && x["group.main"] == "true")
But that yielded a no field group found
which does make sense since it's not a field in the index itself.
TL;DR: Ultimately what I need is, when a User searches a keyword, the search is conducted across all languages and items, but only the items related to the results in the current languages are returned (if I put in a word that is found on the en-gb
version of the item, I want the . I assumed this was what the group
functionality in Solr was built for. At this point I am considering doing a self join, joining the non-grouped results and matching on the group
of a language specific but am not sure that's going to be the solution either.