This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT my_index | |
{ | |
"mappings": { | |
"_doc": { | |
"properties": { | |
"account_id": { | |
"type": "keyword" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT desert_island_disks | |
{ | |
"mappings": { | |
"_doc": { | |
"properties": { | |
"album": { | |
"type": "keyword" | |
}, | |
"artist": { | |
"type": "keyword" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add a test doc | |
$ curl -X PUT server1:9200/test1/_doc/1 -H 'Content-Type: application/json' -d '{}' | |
{"_index":"test1","_type":"_doc","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1} | |
#delete the test doc, get a 200 | |
$ curl -I -X DELETE server1:9200/test1/_doc/1 | |
HTTP/1.1 200 OK | |
content-type: application/json; charset=UTF-8 | |
content-length: 153 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE test | |
PUT test | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"my_case_insensitive_keyword": { | |
"type": "custom", | |
"char_filter": [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE my_index | |
PUT my_index | |
{ | |
"mappings": { | |
"_doc": { | |
"properties": { | |
"ID": { | |
"type": "long", | |
"fields": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE logs_server2 | |
DELETE logs_server3 | |
POST /_forcemerge?only_expunge_deletes=false&max_num_segments=100&flush=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# output from | |
git clone https://github.com/elastic/elasticsearch.git | |
grep -r "controller.registerHandler" elasticsearch | sed -e "s/.*\/_/_/" -e "s/[\/\"].*//" | grep "^_" | sort -u | |
_ack | |
_activate | |
_alias | |
_aliases | |
_analyze | |
_authenticate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############# | |
# tidy up | |
DELETE benchmarking-results | |
# create a mapping to mandate single shard + apply date format | |
PUT benchmarking-results | |
{ | |
"settings": { | |
"number_of_shards": 1, | |
"number_of_replicas": 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Basic Example: a Kibana Visualization + underlying Aggregation | |
First, you need to create an “Index Pattern”. Kibana will use this to identify which Elasticsearch Indexes to include in your Visualization | |
1. Go to Kibana | |
2. Click “Management” in LH sidebar | |
3. Click “Index Patterns” | |
4. Click “Create index pattern” | |
5. In box “Index pattern” box replace “index-name-*” by “blogs*” | |
6. Click “> Next Step” |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# up to the eggs trying to figure out when fiestas are next year? | |
# For 2019 I dumped the fiestas into Json, incuding: | |
# - Fiesta Nacional no sustituible | |
# - Fiesta Nacional respecto de la que no se ha ejercido la facultad de sustitución | |
# - Fiesta de Comunidad Autónoma | |
# Source: https://www.ccoo-servicios.es/archivos/anexo-BOE.pdf | |
# please check vs PDF in case of error & remember to add any city/local fiestas | |
# and then I indexed it in Elasticsearch |