我可以用NodeJS Elastcsearch lib执行搜索( https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/quick-start.html ).
有没有办法对索引执行原始查询?我能执行这样的操作吗:
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" } } } } } })
indices.create