I'm trying to use App Search to build a document search feature. I am storing the text of documents I want to search in an array, where each element is a string consisting of all the text of a single page. My current schema is as follows:
{
"title": "Alice in Wonderland",
"url": "alice_in_wonderland.pdf",
"text": ["text of page 1...",
"text of page 2...",...
"text of page 545.."]
}
App search returns results with the snippet of where the query phrase is found. However, the result doesn't return the page number of where it is found (i.e, which element of the text array). Is there a way to make this happen in App Search? Or do I have to move to regular Elasticsearch.
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"]
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.