Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 使用nodejs lib在elasticsearch上执行原始查询_Node.js_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Kibana - Fatal编程技术网 elasticsearch,kibana,Node.js,elasticsearch,Kibana" /> elasticsearch,kibana,Node.js,elasticsearch,Kibana" />

Node.js 使用nodejs lib在elasticsearch上执行原始查询

Node.js 使用nodejs lib在elasticsearch上执行原始查询,node.js,elasticsearch,kibana,Node.js,elasticsearch,Kibana,我可以使用NodeJS Elastcsearch lib()执行搜索 有没有办法对索引执行原始查询?我可以执行如下操作: PUT index { "settings": { "analysis": { "normalizer": { "my_normalizer": { "type": "custom", "char_filter": [], "filter": ["lowercase", "as

我可以使用NodeJS Elastcsearch lib()执行搜索

有没有办法对索引执行原始查询?我可以执行如下操作:

PUT index
{
  "settings": {
    "analysis": {
      "normalizer": {
        "my_normalizer": {
          "type": "custom",
          "char_filter": [],
          "filter": ["lowercase", "asciifolding"]
        }
      }
    }
  },
  "mappings": {
    "_doc": {
      "properties": {
        "foo": {
          "type": "keyword",
          "normalizer": "my_normalizer"
        }
      }
    }
  }
}

。。。并以JSON的形式获得结果,就像Kibana一样。这可能吗?

您可以使用索引。创建

client.indices.create([params, [callback]])
范例

client.indices.create({
   index: "persons",
   body: {
       "settings" : {
       "number_of_shards" : 1
       },
       "mappings" : {
          "type1" : {
            "properties" : {
            "field1" : { "type" : "text" }
           }
        }
     }
   }
})
检查文档

此答案应有助于: