Skip to main content

KeywordSearchHit

Single keyword search result with contextual snippets.

entry_idEntry Id (integer)required

Entry ID

dataset_idDataset Id (integer)required

Dataset ID

scoreScore (number)required

MeiliSearch ranking score (0.0-1.0)

snippets object[]

Contextual snippets around matches

  • Array [
  • fieldField (string)required

    Source field name (e.g., 'text_content')

    textText (string)required

    Snippet text with tags around matched terms

    matched_termsstring[]required

    Terms that matched in this snippet

    context objectrequired

    Context information for this snippet

    typeType (string)required

    Boundary type used for snippet extraction

    Possible values: [sentence, paragraph, section, cropped]

    section object

    Markdown section heading path (e.g., 'Background > Methods')

    anyOf
    string
    offsetOffset (integer)required

    Character position of snippet start in full document

    cropped_at object

    How snippet was cropped: 'maxLength' if truncated, 'boundary' if natural boundary, null if complete

    anyOf
    string

    Possible values: [maxLength, boundary]

    relevance_scoreRelevance Score (number)

    Snippet relevance score (0.0-1.0)

    Possible values: >= 0 and <= 1

    Default value: 1
  • ]
  • match_countMatch Count (integer)

    Total number of matches in document

    Default value: 0
    has_moreHas More (boolean)

    True if more matches exist beyond max_snippets

    Default value: false
    metadata object

    Dynamic metadata fields from the dataset schema and core entry fields. Contains all entry metadata that fits within size thresholds. Fields exceeding 200 characters or arrays with more than 5 items are listed in truncated_fields instead.

    property name*any

    Dynamic metadata fields from the dataset schema and core entry fields. Contains all entry metadata that fits within size thresholds. Fields exceeding 200 characters or arrays with more than 5 items are listed in truncated_fields instead.

    truncated_fieldsstring[]

    Field names omitted from metadata due to size (strings > 200 chars, arrays > 5 items). Retrieve full values via GET /entries/{entry_id}.

    KeywordSearchHit
    {
    "entry_id": 0,
    "dataset_id": 0,
    "score": 0,
    "snippets": [
    {
    "field": "string",
    "text": "string",
    "matched_terms": [
    "string"
    ],
    "context": {
    "type": "sentence",
    "section": "string",
    "offset": 0,
    "cropped_at": "maxLength"
    },
    "relevance_score": 1
    }
    ],
    "match_count": 0,
    "has_more": false,
    "metadata": {},
    "truncated_fields": [
    "string"
    ]
    }