Elasticsearch Notes: Difference between revisions
From Federal Burro of Information
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 25: | Line 25: | ||
curl 'localhost:9200/_cat/nodes?v' | curl 'localhost:9200/_cat/nodes?v' | ||
== Explicitly mapping date fields == | |||
from: http://joelabrahamsson.com/dynamic-mappings-and-dates-in-elasticsearch/ | |||
<pre> | |||
curl -XPUT "http://localhost:9200/myindex" -d' | |||
{ | |||
"mappings": { | |||
"tweet": { | |||
"date_detection": false, | |||
"properties": { | |||
"postDate": { | |||
"type": "date" | |||
} | |||
} | |||
} | |||
} | |||
}' | |||
</pre> |
Revision as of 19:30, 13 October 2015
elasticsearch-head and elastic search plugin ( https://github.com/mobz/elasticsearch-head )
_search?search_type=count
{ "aggs" : { "all_users": { "terms": { "field": "screen_name" } } } }
list indexes and summary:
curl 'localhost:9200/_cat/indices?v'
show health
curl 'localhost:9200/_cat/health?v'
list nodes:
curl 'localhost:9200/_cat/nodes?v'
Explicitly mapping date fields
from: http://joelabrahamsson.com/dynamic-mappings-and-dates-in-elasticsearch/
curl -XPUT "http://localhost:9200/myindex" -d' { "mappings": { "tweet": { "date_detection": false, "properties": { "postDate": { "type": "date" } } } } }'