Finding snippet location in text array

@coding_martian Search UI doesn't have first class support for grouping, but you can add grouping to your searches using the beforeSearchCall hook. See the example here: https://github.com/elastic/search-ui/blob/master/ADVANCED.md#api-config.

Please note that "tip" at the top of this page: Search API group | App Search documentation [8.11] | Elastic.

A few things to remember when using Grouping: 1. Grouping does not support Curations. 2. Facets only show total results and not total number of groups. 3. Sorting and Paging require the experimental collapse flag to be set to true .

You'll probably want paging and sorting to work so you should use the 'collapse' flag:

"group": { 
  "field": "title",
  "collapse": true
}

The field you are grouping on must not have multiple values. Multiple values will cause an error.

If you're using collapse, you MUST make sure that you do not have multiple values for title in any of your fields. So make sure you don't have data that look like this:

{​
    "title": ["Alice in Wonderland",​ "Alice Returns to Wonderland"]
}

One last note, since Search UI won't know what to do with the grouped results, you'll need to create a custom Result view: Reference UI - how to modify what's displayed (React newbie) - #2 by JasonStoltz. You'll find the "grouped" results in the "_group" field of each record. There is an example response here: Search API group | App Search documentation [8.11] | Elastic.

Hopefully that doesn't sound too intimidating, we actually do this exact same thing on Elastic: Search Results | Elastic.