Created
June 18, 2014 02:37
-
-
Save maruf89/67110409d7a063dd60e0 to your computer and use it in GitHub Desktop.
Elasticsearch Index Updates
This file contains 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
// close the index with `POST` (using `PUT` will throw error) | |
curl -XPOST localhost:9200/users/_close | |
// Update with the analysis with a `PUT` (using `POST` will throw error) | |
curl -XPUT localhost:9200/users/_settings -d '{ | |
"analyzer": { | |
"ngram_languages": { | |
"tokenizer": "ngram_languages_tokenizer" | |
} | |
}, | |
"tokenizer": { | |
"ngram_languages_tokenizer": { | |
"type": "nGram", | |
"min_gram": "3", | |
"max_gram": "6", | |
"token_chars": [ | |
"letter", | |
"punctuation" | |
] | |
} | |
} | |
} | |
}' | |
// Reopen | |
curl -XPOST localhost:9200/users/_open | |
// View Index Config | |
curl -XGET 'http://localhost:9200/_cluster/state?pretty&filter_nodes=true&filter_routing_table=true&filter_indices=users' | |
// View analyzed text | |
curl 'localhost:9200/users/_analyze?pretty=true&analyzer=ngram_languages' -d 'Lithuanian' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment