From 5b60506b2ecc32a27d18eddeebecc4c9e9f39bfe Mon Sep 17 00:00:00 2001 From: Clinton Gormley Date: Wed, 4 Sep 2013 20:24:37 +0200 Subject: [PATCH] [DOCS] Added highlighting to the phrase suggester --- .../search/suggesters/phrase-suggest.asciidoc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/reference/search/suggesters/phrase-suggest.asciidoc b/docs/reference/search/suggesters/phrase-suggest.asciidoc index 1651bc216ea..64b46a5e885 100644 --- a/docs/reference/search/suggesters/phrase-suggest.asciidoc +++ b/docs/reference/search/suggesters/phrase-suggest.asciidoc @@ -37,7 +37,11 @@ curl -XPOST 'localhost:9200/_search' -d { "field" : "body", "suggest_mode" : "always", "min_word_len" : 1 - } ] + } ], + "highlight": { + "pre_tag": "", + "post_tag": "" + } } } } @@ -73,9 +77,11 @@ can contain misspellings (See parameter descriptions below). "length" : 17, "options" : [ { "text" : "xorr the god jewel", + "highlighted": "xorr the god jewel", "score" : 0.17877324 }, { "text" : "xor the god jewel", + "highlighted": "xor the god jewel", "score" : 0.14231323 } ] } ] @@ -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