Hits
Hits return an array containing the matches for the executed query.
The length of the array is equal to or less than the size specified in the request.
- Index
-
The unique ID of the pindex. The index name always begins with a string.
- ID
-
The document ID that matched.
- Score
-
The document score.
- Locations
-
This object contains field names where matches were found. The "Locations" object depends on the term vectors being stored; if term vectors are not stored, locations are not returned in the result object.
{Field Name}
Lists the field names where the match was found. These fields are scoped so that "description: american" searches for "american" scoped to the "description" field. In the example below, there are two fields named "description" and "name".
{Term Found}
A name value pair whose name is the name of the term that was found and whose value is an array on objects representing the vector information that describes the position of the matched term in the field. This value is only present if the term vectors are calculated. For each match, the object contains the position (
pos
), start, end, and array positions (array_positions
).Sample Locations Fragment"locations": { "reviews.content": { "light": [ { "pos": 277, "start": 1451, "end": 1456, "array_positions": [ 0 ] }, { "pos": 247, "start": 1321, "end": 1326, "array_positions": [ 3 ] } ] } },
- Fragments
-
These objects, also known as snippets, contain field names that contain an array of one or more text strings. The text strings contain the "
<mark>
" tags surrounding the term that was matched in order to render highlighting. - Fields
-
This object returns the value of the field that was matched. However, unlike the Fragments field, this does not have any tags to render highlighting.
- Sort
-
This field contains an array of one or more values that were used to sort the search results. Documents that don’t have a value in the index for a particular field used in sorting will return a series of non-printable Unicode characters:
\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd
.