小编yko*_*koo的帖子

如何将elasticsearch查询结果直接存储到新索引?

我有三个问题。

首先,我想知道是否可以使用单个查询将 mtermvectors 查询结果保存回新索引。

其次,如果第一个问题没问题,我想在保存结果时是否可以将当前格式更改为嵌套数据类型。

最后,我想知道是否可以同时进行聚合。是否可以?

现在,我的代码就在这里。

<pre>
GET /_mtermvectors?pretty=true 
{   
  "docs":[
  {   "_index": "test",    
    "_type": "type1",    
    "_id": "2",    
    "fields":["contents"],    
    "offsets":false,    
    "payloads":false,    
    "positions":false,    
    "term_statistics": true,
    "field_statistics":true,   
    "filter":{
    "min_term_freq":1,
    "max_doc_freq": 3
}   },   
 {   "_index": "test",    
   "_type": "type1",    
   "_id": "1",    
   "fields":["contents"],    
   "offsets":false,    
   "payloads":false,    
   "positions":false,    
   "term_statistics": true,
   "field_statistics":true,  
   "filter":{
  "min_term_freq":1,
  "max_doc_freq": 3
}   
} ] }


PUT /new_index
{
  "mappings": {
    "word": {
    "properties": {
       "termsarray": {
         "type": "nested",
          "properties": {
         "form": { 
           "type":"text",
           "fielddata": true
    }
        }
      }
   }
   }
} …
Run Code Online (Sandbox Code Playgroud)

elasticsearch

5
推荐指数
1
解决办法
5419
查看次数

标签 统计

elasticsearch ×1