-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Open
Labels
:Search Relevance/SearchCatch all for Search RelevanceCatch all for Search Relevance>bugTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineers
Description
Elasticsearch Version
7.14.2
Installed Plugins
No response
Java Version
openjdk version "1.8.0-262" OpenJDK Runtime Environment (build 1.8.0-262-b10) OpenJDK 64-Bit Server VM (build 25.71-b10, mixed mode)
OS Version
windows 10
Problem Description
Using the mtermvectors api to get the term vectors (with term_statistics) for an artificial document Elasticsearch will ignore the nested fields.
Steps to Reproduce
To reproduce:
Create the index and upload a doc
PUT /my-index-000001
{
"mappings": {
"properties": {
"user": {
"type": "nested",
"properties": {
"first" : {
"type": "text"
},
"last" : {
"type": "text"
},
"description":{
"type": "text"
}
}
}
}
}
}
PUT /my-index-000001/_doc/1
{
"group" : "fans",
"user" : [
{
"first" : "John",
"last" : "Smith",
"description":"first description"
},
{
"first" : "Alice",
"last" : "White",
"description":"second description"
}
]
}
Request the term vector for an artificial document
GET my-index-000001/_mtermvectors
{
"docs": [
{
"doc" : {
"group":"test",
"user" : [
{
"first" : "John",
"last" : "Smith",
"description":"artificial description"
}
]
},
"fields": ["*"],
"term_statistics":true,
"positions":false,
"offsets":false
}
]
}
Response
{
"docs": [
{
"_index": "my-index-000001",
"_type": "_doc",
"_version": 0,
"found": true,
"took": 0,
"term_vectors": {
"group": {
"field_statistics": {
"sum_doc_freq": 1,
"doc_count": 1,
"sum_ttf": 1
},
"terms": {
"test": {
"term_freq": 1
}
}
}
}
}
]
}
The response does not include the term vector for the nested field.
Logs (if relevant)
No response
Metadata
Metadata
Assignees
Labels
:Search Relevance/SearchCatch all for Search RelevanceCatch all for Search Relevance>bugTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineers