-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Fast vector highlighting span queries for nested documents #24318
Copy link
Copy link
Closed
Labels
:Search Relevance/HighlightingHow a query matched a documentHow a query matched a document>docsGeneral docs changesGeneral docs changesTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme
Description
Elasticsearch version: 5.3.1
Plugins installed: [mapper-murmur3, mapper-size, x-pack]
JVM version: OpenJDK 1.8.0_131
OS version: CentOS Linux release 7.3.1611 (Core)
Description of the problem including expected versus actual behavior:
Fast vector highlighting does not work on a nested document, with span_near or span_first queries (additional span queries may be affected)
Steps to reproduce:
1.
PUT /test
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
},
"mappings" : {
"object" : {
"properties" : {
"document_part" : {
"type" : "nested",
"properties": {
"text": {
"type": "text",
"term_vector": "with_positions_offsets"
}
}
}
}
}
}
}
POST /test/object/1
{
"document_part": {
"text": "Here is some text to be analyzed and later queried on. Let us use everyones favourite... The cat sat on the mat near the dog. The cat saw the dog."
}
}
GET /test/object/_search
{
"_source": false,
"query": {
"nested": {
"path": "document_part",
"query": {
"span_near": {
"clauses": [
{
"span_term": { "document_part.text": "cat" }
},
{
"span_term": { "document_part.text": "dog" }
}
],
"slop": 5,
"in_order": false
}
},
"inner_hits": {
"_source": false,
"highlight": {
"fields": {"document_part.text": {}}
}
}
}
}
}
- Note that in the response the _search in step 3, a hit is found, but no higlight. With just a span_term query the highlight is seen. And forcing the highlight type to be "plain" the highlight is seen.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Search Relevance/HighlightingHow a query matched a documentHow a query matched a document>docsGeneral docs changesGeneral docs changesTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchgood first issuelow hanging fruitlow hanging fruithelp wantedadoptmeadoptme
Type
Fields
Give feedbackNo fields configured for issues without a type.