Multi termvectors API允许一次获得多个词条向量。检索词条向量的文档由索引 、类型和ID指定。但文件也可以在请求本身中人为地提供。 响应包括一个具有所有获取的术语的docs
数组,每个元素具有由termvectors API提供的结构。这是一个例子:
POST /_mtermvectors
{
"docs": [
{
"_index": "twitter",
"_type": "tweet",
"_id": "2",
"term_statistics": true
},
{
"_index": "twitter",
"_type": "tweet",
"_id": "1",
"fields": [
"message"
]
}
]
}
POST /twitter/_mtermvectors
{
"docs": [
{
"_type": "tweet",
"_id": "2",
"fields": [
"message"
],
"term_statistics": true
},
{
"_type": "tweet",
"_id": "1"
}
]
}
POST /twitter/tweet/_mtermvectors
{
"docs": [
{
"_id": "2",
"fields": [
"message"
],
"term_statistics": true
},
{
"_id": "1"
}
]
}
POST /twitter/tweet/_mtermvectors
{
"ids" : ["1", "2"],
"parameters": {
"fields": [
"message"
],
"term_statistics": true
}
}
POST /_mtermvectors
{
"docs": [
{
"_index": "twitter",
"_type": "tweet",
"doc" : {
"user" : "John Doe",
"message" : "twitter test test test"
}
},
{
"_index": "twitter",
"_type": "test",
"doc" : {
"user" : "Jane Doe",
"message" : "Another twitter test ..."
}
}
]
}