0
にクエリ文字列を使用してこんにちは、私はelasticsearch v2.3の 中のハイライトといくつかの問題があり、2つの例です:奇妙な正確なクエリのためのハイライトとOR elasticsearch
この
GET reports_all/all/_search
{
"query": {
"query_string": {
"fields": [
"text"
],
"query": "(\"base of the pyramid impact assessment\" OR \"corporate human rights benchmark\")"
// "query": "(\"corporate human rights benchmark\" OR \"base of the pyramid impact assessment\")"
}
},
"highlight": {
"pre_tags": [
"<mark>"
],
"post_tags": [
"</mark>"
],
"fields": {
"text": {
"number_of_fragments": 10
}
}
},
"size": 10,
"from": 0
}
照会部分を2つの完全一致またはORで区切ります。私はちょうど第一及び第二のフレーズを交換し、これは間違っているテキストで強調して最初の1の結果である:
"highlight": {
"text": [
" organisations to launch <mark>the</mark> \n<mark>Corporate</mark> <mark>Human</mark> <mark>Rights</mark> <mark>Benchmark</mark> (CHRB), <mark>the</mark> \nworld’s first wide-scale project to",
" taking \naction to reduce <mark>the</mark> environmental \n<mark>impact</mark> <mark>of</mark> our business and finding \nnew ways to help",
" focuses <mark>of</mark> this is reducing <mark>the</mark> <mark>impact</mark> <mark>of</mark> \nclimate change. Aviva Investors signed <mark>the</mark> Montreal Carbon",
" \nprogrammes in 2015\n</p>\n<p>Our 2015 reporting\nThis is <mark>the</mark> summary <mark>of</mark> our sustainable\nbusiness and corporate",
" aim to uphold <mark>the</mark> highest ethical \nstandards in <mark>the</mark> way that we do business. \nIn 2015, 98% <mark>of</mark> Aviva",
" costs to \nour customers\n</p>\n<p> Reducing our\nenvironmental <mark>impact</mark>\nIn 2015 Aviva became <mark>the</mark>",
" first insurer \nto achieve <mark>the</mark> Carbon Trust Supply Chain \nStandard, in recognition <mark>of</mark> work to measure",
" Stonewall’s \nTop 100 Employers list\n</p>\n<p>A principal partner \n<mark>of</mark> <mark>the</mark> Living Wage \nFoundation",
" take control <mark>of</mark> their finances, as\nwell as benefiting society and <mark>the</mark> environment\n</p>\n<p>• <mark>The</mark> way",
" we help our local communities, giving\nthousands <mark>of</mark> organisations <mark>the</mark> support they need\nto make a"
]
}
}、
が、第2 1の結果は罰金です:
"highlight": {
"text": [
" organisations to launch the \n<mark>Corporate</mark> <mark>Human</mark> <mark>Rights</mark> <mark>Benchmark</mark> (CHRB), the \nworld’s first wide-scale project to"
]
}
が悪かったのかもしれないものの任意のアイデア?