Skip to content

Instantly share code, notes, and snippets.

DELETE slow_test
PUT /slow_test
{
"mappings": {
"test": {
"properties": {
"hotel_name": {
"type": "text",
@TomonoriSoejima
TomonoriSoejima / moving snapshot
Last active August 2, 2017 05:58
snapshot and restore
DELETE test
PUT test/
{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 1
}
}
@TomonoriSoejima
TomonoriSoejima / sample 1
Last active July 15, 2017 05:39
painless timestamp update sample
GET hotel2/_search
{
"_source": [
"created",
"created2"
],
"script_fields": {
"original_date": {
"script": {
"lang": "painless",
@TomonoriSoejima
TomonoriSoejima / gist:300ea259bd31be66d57625be2823e885
Last active September 22, 2017 03:14
kuromoji with phrase test on 5.x
GET _cat/plugins/
# settings
PUT /kuro/
{
"settings": {
"index":{
"analysis":{
"analyzer" : {
"my_analyzer" : {
@TomonoriSoejima
TomonoriSoejima / gist:37b5c0a2a71003966fa6b096ab52a8ab
Last active June 13, 2017 03:46
ML apis for troubleshooting
# replace <alias_test> with your own <alias name>
GET _alias/alias_test
# replace <job1> with your own <job id>
# The get jobs API enables you to retrieve configuration information for jobs.
GET _xpack/ml/anomaly_detectors/job1
# The get jobs API enables you to retrieve usage information for jobs.
GET /_xpack/ml/anomaly_detectors/job1/_stats
delete old new
# alias sample
PUT old/test/1
{
"name" : "Tim"
}
delete old new
PUT old/test/1
{
"name" : "Sam"
}
POST _reindex
{
"source": {
# hdfs getconf -confKey fs.default.name
# when you run into error in connecting to hadoop, run above.
# Then the output is what you need to specify at uri in settngs.
PUT _snapshot/tomo_repository
{
"type": "hdfs",
"settings": {
"uri": "hdfs://localhost:9000/",
delete old
PUT old/test/1
{
"first_name" : "Sam"
}
GET old/_mapping
PUT old/_mapping/test
@TomonoriSoejima
TomonoriSoejima / case1
Last active June 20, 2017 08:24
ingest api with timestamp
#pattern 1
POST _ingest/pipeline/_simulate
{
"pipeline": {
"processors": [
{
"kv": {
"field": "http_message",
"field_split": " ",
"value_split": ""