Overview
In most cases, the content of a document is large in size. When you search for a document, the full content of the document may not be displayed. You can specify the information that you want to be displayed and highlighted. Havenask provides the dynamic summary configuration feature. When you write a query statement, you can specify the fields that you want to be displayed and highlighted in the summary of the search result.
Syntax
Include freeschema_extract_fields in the kvpairs clause to specify the fields that are displayed in the summary of the search result. The following example shows how to define freeschema_extract_fields:
# The content and title fields are displayed in the summary of the search result.
content`21`250`2<em>`2</em>`2...`1title`21`290`2<em>`2</em>`2...
# The result summary that is displayed. In the summary, Search is highlighted.
{
"content" : "<em>Search</em> engine"
}Use `1 to separate multiple fields.
Use `2 to separate the information about each field, including the field name, the number of fragments, the length of each fragment, the start point of the highlighted part, and the end point of the highlighted part. Use `2 as a connector for multiple fragments.
Example:
config=start:0,hit:10,format:json&&query=default:'Search'&&kvpairs=freeschema_extract_fields:content`21`250`2<em>`2</em>`2...`1title`21`290`2<em>`2</em>`2...Usage notes
The fields that you specify for the summary must be included in the schema and the summary indexes.