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
| // Start the first node and keep the generated security credentials handy | |
| docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0 | |
| // Check if the node has started correctly | |
| curl --insecure --user elastic https://localhost:9200/ | |
| // Add your second node | |
| docker run -e ENROLLMENT_TOKEN="..." -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -it docker.elastic.co/elasticsearch/elasticsearch:8.0.0 | |
| // Check if it has joined the cluster |
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 jobs | |
| { | |
| "mappings": { | |
| "properties": { | |
| "title": { | |
| "type": "search_as_you_type" | |
| } | |
| } | |
| } | |
| } |
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 test/_doc/1 | |
| { | |
| "test A": "a", | |
| "test B": "b" | |
| } | |
| GET test/_search | |
| { | |
| "query": { | |
| "match": { | |
| "test A": "a" |
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 test | |
| { | |
| "mappings": { | |
| "properties": { | |
| "linked_ent": { | |
| "type": "nested", | |
| "properties": { | |
| "score": { | |
| "type": "float" | |
| } |
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
| GET / | |
| GET /_analyze | |
| { | |
| "analyzer": "english", | |
| "text": "These are not the droids you are looking for." | |
| } | |
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 | |
| { | |
| "mappings": { | |
| "properties": { | |
| "url": { | |
| "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 _template/sample | |
| { | |
| "index_patterns": ["sample-*"], | |
| "version": 27, | |
| "settings": { | |
| "index.refresh_interval": "5s", | |
| "number_of_shards": 4, | |
| "number_of_replicas": 1 | |
| }, | |
| "mappings": { |
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 /test_index | |
| { | |
| "settings": { | |
| "index": { | |
| "analysis": { | |
| "analyzer": { | |
| "synonym_analyzer": { | |
| "tokenizer": "standard", | |
| "filter": [ | |
| "synonym_graph" |
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
| ELASTIC_VERSION=6.5.3 |
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 | |
| { | |
| "settings": { | |
| "number_of_shards": 1 | |
| }, | |
| "mappings": { | |
| "_doc": { | |
| "properties": { | |
| "first_name": { |