Skip to content

Commit

Permalink
[DOCS] Added highlighting to the phrase suggester
Browse files Browse the repository at this point in the history
  • Loading branch information
clintongormley committed Sep 4, 2013
1 parent 53ad733 commit 5b60506
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/reference/search/suggesters/phrase-suggest.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ curl -XPOST 'localhost:9200/_search' -d {
"field" : "body",
"suggest_mode" : "always",
"min_word_len" : 1
} ]
} ],
"highlight": {
"pre_tag": "<em>",
"post_tag": "</em>"
}
}
}
}
Expand Down Expand Up @@ -73,9 +77,11 @@ can contain misspellings (See parameter descriptions below).
"length" : 17,
"options" : [ {
"text" : "xorr the god jewel",
"highlighted": "<em>xorr</em> the <em>god</em> jewel",
"score" : 0.17877324
}, {
"text" : "xor the god jewel",
"highlighted": "xor the <em>god</em> jewel",
"score" : 0.14231323
} ]
} ]
Expand Down Expand Up @@ -144,6 +150,14 @@ can contain misspellings (See parameter descriptions below).
`text`::
Sets the text / query to provide suggestions for.

`highlight`::
Sets up suggestion highlighting. If not provided then
no `highlighted` field is returned. If provided must
contain exactly `pre_tag` and `post_tag` which are
wrapped around the changed tokens. If multiple tokens
in a row are changed the entire phrase of changed tokens
is wrapped rather than each token.

==== Smoothing Models

The `phrase` suggester supports multiple smoothing models to balance
Expand Down

0 comments on commit 5b60506

Please sign in to comment.