[DOCS] Reorganised the highlight_query docs and added a version flag

This commit is contained in:
Clinton Gormley 2013-10-18 18:03:31 +02:00
parent b7d8c275eb
commit b2d82d7e75
1 changed files with 28 additions and 26 deletions

View File

@ -142,6 +142,30 @@ order by score:
} }
-------------------------------------------------- --------------------------------------------------
If the `number_of_fragments` value is set to 0 then no fragments are
produced, instead the whole content of the field is returned, and of
course it is highlighted. This can be very handy if short texts (like
document title or address) need to be highlighted but no fragmentation
is required. Note that `fragment_size` is ignored in this case.
[source,js]
--------------------------------------------------
{
"query" : {...},
"highlight" : {
"fields" : {
"_all" : {},
"bio.title" : {"number_of_fragments" : 0}
}
}
}
--------------------------------------------------
When using `fast-vector-highlighter` one can use `fragment_offset`
parameter to control the margin to start highlighting from.
==== Highlight query
It is also possible to highlight against a query other than the search It is also possible to highlight against a query other than the search
query by setting `highlight_query`. This is especially useful if you query by setting `highlight_query`. This is especially useful if you
use a rescore query because those are not taken into account by use a rescore query because those are not taken into account by
@ -213,28 +237,6 @@ Note the score of text fragment in this case is calculated by Lucene
highlighting framework. For implementation details you can check highlighting framework. For implementation details you can check
`ScoreOrderFragmentsBuilder.java` class. `ScoreOrderFragmentsBuilder.java` class.
If the `number_of_fragments` value is set to 0 then no fragments are
produced, instead the whole content of the field is returned, and of
course it is highlighted. This can be very handy if short texts (like
document title or address) need to be highlighted but no fragmentation
is required. Note that `fragment_size` is ignored in this case.
[source,js]
--------------------------------------------------
{
"query" : {...},
"highlight" : {
"fields" : {
"_all" : {},
"bio.title" : {"number_of_fragments" : 0}
}
}
}
--------------------------------------------------
When using `fast-vector-highlighter` one can use `fragment_offset`
parameter to control the margin to start highlighting from.
[[highlighting-settings]] [[highlighting-settings]]
==== Global Settings ==== Global Settings