Skip to main content

elastic search commands

PUT twitter/_doc/1
{
    "user" : "kimchy",
    "message" : "trying out Elasticsearch having running all the way goes down sizing are is the"
}

PUT /my_index1
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my": {
          "type": "standard",
          "stopwords": [ "is", "having" ]
        }
      }
    }
  }
}



GET /_search?q=having   

GET /_analyze
{
  "analyzer": "standard",
  "text": "trying out Elasticsearch having running all the way goes down sizing are is the"
}

GET /_analyze?tokenizer=whitespace
{"You're the 1st runner home!"}

POST _analyze
{
  "analyzer": "my_analyzer",
  "text":     "The quick brown fox."
}


PUT /my_index
{
  "mappings": {
    "blog": {
      "properties": {
        "title": {
          "type": "text",
          "fields": {
            "english": {
              "type":     "text",
              "analyzer": "english"
            }
          }
        }
      }
    }
  }
}


GET my_index1/_analyze
{
  "analyzer": "my",
  "text":     "trying out Elasticsearch having running all the way goes down sizing are is the"
}




PUT /my_index/blog/1
{ "title": "I'm happy for this fox" }

PUT /my_index/blog/2
{ "title": "i love new york the ny city" }

GET /_search
{
  "query": {
    "multi_match": {
      "type":     "most_fields",
      "query":    "not happy foxes",
      "fields": [ "title", "title.english" ]
    }
  }
}

Get allvideos/_search?q=knowledge



POST /allvideos/_search
{
    "query": {
        "match" : {
            "script" : "knowledge"
        }
    },
    "size": 2,
    "from": 0,
    "_source": [ "title", "script" , "description", "videoId"]
}




POST /individualvideos/_search
{
   
  "query": {
    "bool": {
      "should": [
        { "match": { "dialog":  "knowledge" }},
        { "match": { "videoId": "-X21K4ixPH8"   }}
      ]
    }
  }
},
    "size": 4,
    "from": 0,
    "_source": [ "dialog" ]
}

PUT /my_index
{
  "settings": {
    "analysis": {
      "filter": {
        "my_synonym_filter": {
          "type": "synonym",
          "synonyms": [
            "british,english",
            "queen,monarch"
          ]
        }
      },
      "analyzer": {
        "my_synonyms": {
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "my_synonym_filter"
          ]
        }
      }
    }
  }
}

GET /my_index/_analyze
{
  "analyzer" : "my_synonyms",
  "text" : "Elizabeth is the English queen"
}

"settings": {
        "analysis": {
            "analyzer": {
                "syn_text": {
                    "tokenizer": "standard",
                    "filter": ["health_synonym"]
                }
            },
            "filter": {
                "health_synonym": {
                    "type": "synonym",
                    "synonyms": ["heart attack, myocardial infarction, mi, cardiac arrest, heartattack"]
                }
            }
        }       
    }
   
   
PUT /test_index
{
    "settings": {
        "index" : {
            "analysis" : {
                "filter" : {
                    "synonym" : {
                        "type" : "synonym",
                        "synonyms_path" : "analysis/synonym.txt",
                        "tokenizer" : "whitespace"
                    }
                },
                "analyzer" : {
                    "synonym" : {
                        "tokenizer" : "whitespace",
                        "filter" : ["synonym"]
                    }
                }
            }
        }
    }
}


GET /_search
{
   "query": {
       "query_string" : {
           "default_field": "title",
           "query" : "ny city",
           "auto_generate_synonyms_phrase_query" : false
       }
   }
}

PUT /my_index3
{
  "settings": {
    "analysis": {
      "filter": {
        "my_synonym_filter": {
          "type": "synonym",
          "synonyms": [
            "usa,united states,u s a,united states of america"
          ]
        }
      },
      "analyzer": {
        "my_synonyms": {
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "my_synonym_filter"
          ]
        }
      }
    }
  }
}




PUT twitter/_doc/1
{
    "user" : "usa",
    "message" : "trying out Elasticsearch having running all the way usa goes down sizing are is the"
}



PUT /my_index3
{
  "settings": {
    "analysis":{
    "analyzer":{
        "synonyms":{
            "filter":[
                "lowercase",
                "synonym_filter"
            ],
        "tokenizer": "standard"
    }
},
"filter": {
"synonym_filter": {
"type": "synonym",
"synonyms": [
"United States,US,USA,USA=>usa",
"Alabama,Al,Ala,Ala",
"Alaska,Ak,Alas,Alas",
"Arizona,Az,Ariz",
"Arkansas,Ar,Ark",
"California,Ca,Calif,Cal",
"Colorado,Co,Colo,Col",
"Connecticut,Ct,Conn",
"Deleware,De,Del",
"District of Columbia,Dc,Wash Dc,Washington Dc=>Dc",
"Florida,Fl,Fla,Flor",
"Georgia,Ga",
"Hawaii,Hi",
"Idaho,Id,Ida",
"Illinois,Il,Ill,Ills",
"Indiana,In,Ind",
"Iowa,Ia,Ioa",
"Kansas,Kans,Kan,Ks",
"Kentucky,Ky,Ken,Kent",
"Louisiana,La",
"Maine,Me",
"Maryland,Md",
"Massachusetts,Ma,Mass",
"Michigan,Mi,Mich",
"Minnesota,Mn,Minn",
"Mississippi,Ms,Miss",
"Missouri,Mo",
"Montana,Mt,Mont",
"Nebraska,Ne,Neb,Nebr",
"Nevada,Nv,Nev",
"New Hampshire,Nh=>Nh",
"New Jersey,Nj=>Nj",
"New Mexico,Nm,N Mex,New M=>Nm",
"New York,Ny=>Ny",
"North Carolina,Nc,N Car=>Nc",
"North Dakota,Nd,N Dak, NoDak=>Nd",
"Ohio,Oh,O",
"Oklahoma,Ok,Okla",
"Oregon,Or,Oreg,Ore",
"Pennsylvania,Pa,Penn,Penna",
"Rhode Island,Ri,Ri & PP,R Isl=>Ri",
"South Carolina,Sc,S Car=>Sc",
"South Dakota,Sd,S Dak,SoDak=>Sd",
"Tennessee,Te,Tenn",
"Texas,Tx,Tex",
"Utah,Ut",
"Vermont,Vt",
"Virginia,Va,Virg",
"Washington,Wa,Wash,Wn",
"West Virginia,Wv,W Va, W Virg=>Wv",
"Wisconsin,Wi,Wis,Wisc",
"Wyomin,Wi,Wyo"
]
}
}
  }
}
}



GET my_index3/_search
{
  "query": {
    "match": {
      "text": {
        "query": "wyo",
         "analyzer": "synonyms"
      }
    }
  }
}


PUT my_index3/_doc/2
{
  "text": "wi sdfs"
}



PUT /my_index/blog/1
{ "title": "I'm happy for this fox" }


GET /_search
{
  "query": {
    "match" : {
    "location.region.name" : {
        "query" : "Massachusetts",
     
        "analyzer" : "synonyms"
    }
}
  }
}

POST /twitte/ASC
{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch"
}




PUT my_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_custom_analyzer": {
          "type":      "custom",
          "tokenizer": "standard",
          "char_filter": [
            "html_strip"
          ],
          "filter": [
            "lowercase",
            "asciifolding"
          ]
        }
      }
    }
  }
}


POST my_index/_analyze
{
  "analyzer": "my_custom_analyzer",
  "text": "Is this <b>déjà vu</b>?"
}

PUT my_index
{
  "settings": {
    "analysis": {
      "filter": {
        "autocomplete_filter": {
          "type": "edge_ngram",
          "min_gram": 1,
          "max_gram": 20
        }
      },
      "analyzer": {
        "autocomplete": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "autocomplete_filter"
          ]
        }
      }
    }
  },
  "mappings": {
    "_doc": {
      "properties": {
        "text": {
          "type": "text",
          "analyzer": "autocomplete",
          "search_analyzer": "standard"
        }
      }
    }
  }
}

PUT my_index/_doc/1
{
  "text": "Quick Brown Fox"
}

GET my_index/_search
{
  "query": {
    "match": {
      "text": {
        "query": "Quick Br",
        "operator": "and"
      }
    }
  }
}


PUT /allvideos
{
  "settings": {
    "analysis":{
    "analyzer":{
        "synonyms":{
            "filter":[
                "lowercase",
                "synonym_filter"
            ],
        "tokenizer": "standard"
    }
},
"filter": {
 "synonym_filter": {
 "type": "synonym",
 "synonyms_path" : "analysis/synonym.txt"
 }
 }
  }
}
}


GET allvideos/_search
{
  "query": {
    "match": {
      "script": "love"
    }
  }
}


GET  allvideos/_search?q=love


Get allvideos/_search?q=knowledge


GET /allvideos/_mapping



PUT /allvideos
{
  "settings": {
    "analysis":{
    "analyzer":{
        "synonyms":{
            "filter":[
                "lowercase",
                "synonym_filter"
            ],
        "tokenizer": "standard"
    }
},
"filter": {
 "synonym_filter": {
 "type": "synonym",
 "synonyms": [
 "United States,US,USA,USA=>usa",
 "Alabama,Al,Ala,Ala",
 "Alaska,Ak,Alas,Alas",
 "Arizona,Az,Ariz",
 "Arkansas,Ar,Ark",
 "California,Ca,Calif,Cal",
 "Colorado,Co,Colo,Col",
 "Connecticut,Ct,Conn",
 "Deleware,De,Del",
 "District of Columbia,Dc,Wash Dc,Washington Dc=>Dc",
 "Florida,Fl,Fla,Flor",
 "Georgia,Ga",
 "Hawaii,Hi",
 "Idaho,Id,Ida",
 "Illinois,Il,Ill,Ills",
 "Indiana,In,Ind",
 "Iowa,Ia,Ioa",
 "Kansas,Kans,Kan,Ks",
 "Kentucky,Ky,Ken,Kent",
 "Louisiana,La",
 "Maine,Me",
 "Maryland,Md",
 "Massachusetts,Ma,Mass",
 "Michigan,Mi,Mich",
 "Minnesota,Mn,Minn",
 "Mississippi,Ms,Miss",
 "Missouri,Mo",
 "Montana,Mt,Mont",
 "Nebraska,Ne,Neb,Nebr",
 "Nevada,Nv,Nev",
 "New Hampshire,Nh=>Nh",
 "New Jersey,Nj=>Nj",
 "New Mexico,Nm,N Mex,New M=>Nm",
 "New York,Ny=>Ny",
 "North Carolina,Nc,N Car=>Nc",
 "North Dakota,Nd,N Dak, NoDak=>Nd",
 "Ohio,Oh,O",
 "Oklahoma,Ok,Okla",
 "Oregon,Or,Oreg,Ore",
 "Pennsylvania,Pa,Penn,Penna",
 "Rhode Island,Ri,Ri & PP,R Isl=>Ri",
 "South Carolina,Sc,S Car=>Sc",
 "South Dakota,Sd,S Dak,SoDak=>Sd",
 "Tennessee,Te,Tenn",
 "Texas,Tx,Tex",
 "Utah,Ut",
 "Vermont,Vt",
 "Virginia,Va,Virg",
 "Washington,Wa,Wash,Wn",
 "West Virginia,Wv,W Va, W Virg=>Wv",
 "Wisconsin,Wi,Wis,Wisc",
 "Wyomin,Wi,Wyo"
 ]
 }
 }
  }
}
}




GET allvideos/_search
{
    "query": {
        "common": {
            "description": {
                "query": "deal fear^2",
                "cutoff_frequency": 0.001
            }
        }
    }
}


GET allvideos/_search
{
   "query": {
      "match": {
         "description": {
            "query": "deal fear is this that what",
            "cutoff_frequency": 0.001
         }
      }
   }
}


GET /_search
{
    "query": {
        "query_string": {
            "query": "love moves the world"
           
        }
    }
}

Get allvideos/_search?q=fright


PUT /allvideos2
{
  "analysis": {
    "filter": {
      "synonym": {
        "type": "synonym",
        "synonyms": [
          "small, tiny"
        ]
      }
    },
    "analyzer": {
      "synonymAnalyzer": {
        "type": "custom",
        "tokenizer": "standard",
        "filter": [
          "lowercase",
          "synonym"
        ]
      }
    }
  }
}

PUT /allvideos2
{
    "settings": {
        "index" : {
            "analysis" : {
                "filter" : {
                    "synonym" : {
                        "type" : "synonym",
                        "format" : "wordnet",
                        "synonyms" : [
                            "s(100000001,1,'abstain',v,1,0).",
                            "s(100000001,2,'refrain',v,1,0).",
                            "s(100000001,3,'desist',v,1,0)."
                        ]
                    }
                }
            }
        }
    }
}


PUT /allvideos
{
  "settings": {
    "analysis":{
    "analyzer":{
        "synonyms":{
            "filter":[
                "lowercase",
                "synonym_filter"
            ],
        "tokenizer": "standard"
    }
},
"filter": {
 "synonym_filter": {
 "type": "synonym",
 "format" : "wordnet",
 "synonyms_path" : "analysis/wn_s.pl"

 }
 }
  }
}
}


PUT /individualvideos
{
  "settings": {
    "analysis":{
    "analyzer":{
        "synonyms":{
            "filter":[
                "lowercase",
                "synonym_filter"
            ],
        "tokenizer": "standard"
    }
},
"filter": {
 "synonym_filter": {
 "type": "synonym",
 "format" : "wordnet",
 "synonyms_path" : "analysis/wn_s.pl"

 }
 }
  }
}
}



POST allvideos/_analyze
{
  "analyzer": "synonyms",
  "text":     "feeling good"
}

GET allvideos/_search
{
  "query": {
    "match": {
      "description": {
        "query": "tell me about relationship",
         "analyzer": "synonyms"
      }
    }
  }
}

GET individualvideos/_search
{
  "from" : 0, "size" : 3,
  "query": {
    "match": {
      "dialog": {
        "query": "lonesome",
         "analyzer": "synonyms"
      }
    }
  }
}



GET allvideos/_search
{
 
  "query": {
    "match": {
      "script": {
        "query": "shiva",
         "analyzer": "synonyms"
      }
    }
  }
}

Get allvideos/_search?q="maya"


Get individualvideos/_search
{
"query": {
          "bool": {
              "should": [{
                      "match": {
                          "dialog": "shiva"
                      }
                  },
                  {
                      "match": {
                          "videoId": "M0HuLasTGjc"
                      }
                  }
              ]
          }
      }
      }
     
     
POST  /individualvideos/_search
{
    "query": {
        "bool": {
            "should": {
                "bool" : { "should": [
                      { "match": { "dialog": "tell me about maya" }}
                      ] }
            },
            "must": { "match": { "videoId": "y0G2tYR6" }}
           
        }
    }
}


     
POST  /individualvideos/_search
{
    "query": {
        "bool": {
            "should": {
                "bool" : { "should": [
                      { "match": { "dialog": {
                          "query": "make love"
                           "query": query,
                        "analyzer": "synonyms"
                      } }}
                      ] }
            },
            "must": { "match": { "videoId": "lOOeHa6PGNU" }}
           
        }
    }
}

Get allvideos/_search?q="secrets"

GET allvideos/_search
{
    "query": {
        "query_string": {
            "query": "secrets of management"
           
        }
    }
}



POST allvideos/_search
{
    "query": {
        "multi_match" : {
            "query" : "secrets of management",
            "fields": ["title^23", "script", "description^2"]
        }
    },
    "_source": ["title", "summary", "publish_date"]
}

PUT index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "english_exact": {
          "tokenizer": "standard",
          "filter": [
            "lowercase"
          ]
        }
      }
    }
  },
  "mappings": {
    "_doc": {
      "properties": {
        "body": {
          "type": "text",
          "analyzer": "english",
          "fields": {
            "exact": {
              "type": "text",
              "analyzer": "english_exact"
            }
          }
        }
      }
    }
  }
}


PUT index/_doc/1
{
  "body": "Ski resort"
}

PUT index/_doc/2
{
  "body": "A pair of skis"
}

PUT index/_doc/3
{
  "body": "this universe it very good"
}

GET index/_search
{
  "query": {
    "simple_query_string": {
      "fields": [ "body" ],
      "query": "ski"
    }
  }
}

GET index/_search
{
  "query": {
    "simple_query_string": {
      "fields": [ "body.exact" ],
      "query": "ski"
    }
  }
}


GET index/_search
{
   "query": {
        "query_string": {
            "query": "university"
           
        }
    }
}

PUT index2/_doc/3
{
  "body": "this universe it very good"
}

GET index2/_search
{
   "query": {
        "query_string": {
            "query": "university"
           
        }
    }
}

DELETE /allvideos

DELETE /individualvideos

DELETE /hindiallvideos

DELETE /hindiindividualvideos

DELETE /modifiedhindiindividualvideos

DELETE /modifiedhindiallvideos

DELETE /tedall

DELETE /tedindi

DELETE  /arnaball

DELETE /arnabindividual


PUT index2/_doc/3
{
  "body": "मेरा गुरु सबसे अच्छा है"
}


PUT /index2/_doc/_mapping
{
  "doc": {
    "properties": {
      "title": {
        "type": "string",
        "fields": {
          "exact": {
            "type": "string",
            "index": "not_analyzed"
          },         
          "synonym": {
            "type": "string",
            "index": "analyzed",
            "analyzer": "synonym_analyzer"
          },
          "stemmed": {
            "type": "string",
            "index": "analyzed",
            "analyzer": "stemming_analyzer"
          }
        }
      }
    }
  }
}


PUT /my_index3/blog/1
{ "title": "I'm happy for this fox" }


PUT /my_index3/blog/_mapping
{
  "blog": {
    "properties": {
      "title": {
        "type": "text",
        "fields": {
          "exact": {
            "type": "keyword",
            "index": "not_analyzed"
          },         
          "synonym": {
            "type": "keyword",
            "index": "analyzed",
            "analyzer": "synonym_analyzer"
          },
          "stemmed": {
            "type": "keyword",
            "index": "analyzed",
            "analyzer": "stemming_analyzer"
          }
        }
      }
    }
  }
}


PUT my_index4
{
   "settings": {
    "analysis": {
      "filter": {
        "arabic_stop": {
          "type":       "stop",
          "stopwords":  "_arabic_"
        },
        "arabic_keywords": {
          "type":       "keyword_marker",
          "keywords":   ["مثال"]
        },
        "arabic_stemmer": {
          "type":       "stemmer",
          "language":   "arabic"
        }
      },
      "analyzer": {
        "stemming_analyzer": {
          "tokenizer":  "standard",
          "filter": [
            "lowercase",
            "arabic_stop",
            "arabic_normalization",
            "arabic_keywords",
            "arabic_stemmer"
          ]
        },
        "synonym_analyzer": {
          "tokenizer":  "standard",
          "filter": [
            "lowercase",
            "arabic_stop",
            "arabic_normalization",
            "arabic_keywords",
            "arabic_stemmer"
          ]
        }
       
      }
    }
  },
  "mappings":{
    "blog":{
          "properties": {
    "title": {
        "type": "text",
        "fields": {
          "exact": {
            "type": "text"
           
          },         
          "synonym": {
            "type": "text",
           
            "analyzer": "synonym_analyzer"
          },
          "stemmed": {
            "type": "text",
           
            "analyzer": "stemming_analyzer"
          }
        }
      }
    }
    }

  }
}





PUT /testallvideos
{
  "settings": {
    "analysis":{
    "analyzer":{
        "synonyms":{
            "filter":[
                "lowercase",
                "synonym_filter"
            ],
        "tokenizer": "standard"
    }
},
"filter": {
 "synonym_filter": {
 "type": "synonym",
 "format" : "wordnet",
 "synonyms_path" : "analysis/wn_s.pl"

 }
 }
  }
}
}


PUT /testindividualvideos
{
"settings": {
"analysis": {
"analyzer": {
"synonyms": {
"filter": [
"lowercase",
"synonym_filter"
],
"tokenizer": "standard"
}
},
"filter": {
"synonym_filter": {
"type": "synonym",
"format": "wordnet",
"synonyms_path": "analysis/wn_s.pl"

}
}
}
}
}



POST testallvideos/_analyze
{
  "analyzer": "synonyms",
  "text":     "feeling good"
}

GET testallvideos/_search
{
  "query": {
    "match": {
      "script": {
        "query": "wise",
         "analyzer": "synonyms"
      }
    }
  }
}

GET testallvideos/_search
{
  "query": {
    "match": {
      "script": {
        "query": "relationship"
       
      }
    }
  }
 
}


Get testindividualvideos/_search?q=wise

GET testindividualvideos/_search
{
  "query": {
    "match": {
      "dialog": {
        "query": "wise",
         "analyzer": "synonyms"
      }
    }
  },
   "highlight" : {
        "fields" : {
            "dialog" : {}
        }
    }

}


GET testindividualvideos/_search
{
  "query": {
    "multi_match": {
      "query": "wise",
     // "analyzer":   "synonyms",
     "type":       "most_fields",
      "fields": [
        "dialog"
      ]
    }
  }
}

PUT /testindividualvideos
{
"settings": {
"analysis": {
"analyzer": {
"synonyms": {
"filter": [
"lowercase",
"synonym_filter"
],
"tokenizer": "standard"
}
},
"filter": {
"synonym_filter": {
"type": "synonym",
"format": "wordnet",
"synonyms_path": "analysis/wn_s.pl"

}
}
}
}
,"mappings": {
    "map1": {
      "properties": {
        "text": {
          "type": "text",
          "fields": {
            "dialog": {
              "type":     "text",
              "analyzer": "synonyms"
            }
          }
        }
      }
    }
  }
}


Delete testindividualvideos

DELETE testsub


GET /testsuball

GET /testallvideos



GET testsuball/_search
{
   "query": {
        "query_string": {
            "query": "the"
        }
    }
}

GET testsubindi/_search
{
   "query": {
        "query_string": {
            "query": "the"
           
        }
    }
}




PUT my_index7/_doc/2
{
  "message": "some arrays in this document...",
  "tags":  [ "elasticsearch", "wow" ],
  "lists": [
    {
      "name": "prog_list",
      "description": "programming list"
    },
    {
      "name": "cool_list",
      "description": "cool stuff list"
    }
  ]
}


GET my_index7/_search
{
  "query": {
    "match": {
      "tags": "elasticsearch"
    }
  }
}


PUT /_cluster/settings
{
  "persistent" : {
    "cluster.blocks.read_only" : false
  }
}

PUT /my_index8/groups/2
{
    "names": [ "John", "Lincoln Smith", "ira"]
}

GET /my_index8/groups/_search
{
    "query": {
        "match_phrase": {
            "names": "Abraham Lincoln"
        }
    }
}

PUT /my_index8/_settings
{
  "index.blocks.read_only_allow_delete": null
}

PUT /my_index10/groups/2
{
    "names": [ "John", "Lincoln Smith", "ira"]
}

GET /my_index11/groups/_search
{
    "query": {
        "match_phrase": {
            "names": "Lincoln"
        }
    }
}


PUT /my_index11/groups/2
{
    "names": [ "John", "Lincoln Smith", "ira"]
}

PUT /my_index11/groups/3
{
    "names": [ "kira", "mila", "pipa"]
}



PUT twitter/_doc/14
{
    "user" : "kimchy",
    "message" : "trying out Elasticssdsdearchsdfsd xdfx down sizing are is the"
}

GET /twitter/_doc/_search
{
    "query": {
        "match_phrase": {
            "user": "Kimchy"
        }
    }
}





PUT my_index/_doc/1
{
  "message": "some arrays in this document...",
  "tags":  [ "elasticsearch", "wow" ],
  "lists": [
    {
      "name": "prog_list",
      "description": "programming list"
    },
    {
      "name": "cool_list",
      "description": "cool stuff list"
    }
  ]
}

GET my_index/_search
{
  "query": {
    "match": {
      "tags": "elasticsearch"
    }
  }
}

PUT my_index/_doc/2
{
  "message": "no arrays in this document...",
  "tags":  "elasticsearch",
  "lists": {
    "name": "prog_list",
    "description": "programming list"
  }
}

PUT my_index/_doc/3
{
  "message": "no arrays in this document...",
  "tags":  "elasticsearch",
  "lists": {
    "name": "prog_lidst",
    "description": "progdramming list"
  }
}

PUT my_index4/_doc/1
{
    "title": ["The Artist", "Formerly known as Prince" ],
    "genres": ["Drama", "Comedy"]
 
}

PUT my_index4/_doc/2
{
    "title": ["The Arsstist", "Formerly known as Prince" ],
    "genres": ["Drama", "Comedy","ASD","SDF"]
 
}

PUT my_index4/_doc/3
{
    "title": ["lika", "mima" ],
    "genres": ["hola", "pola","kola","sola"]
 
}

PUT my_index4/_doc/4
{
    "title": ["lika", "mima" ],
    "genres": ["hola", "pika","pika","sola"]
 
}

GET my_index4/_search
{
  "query": {
    "match": {
      "genres": "hola , drama"
    }
  }
}


Get pipa/_search
{
  "query":{
    "match": {
      "SusbcriberUserId": "kishlay"
    }
  }
}

POST /tedall/_cache/clear

POST /_cache/clear

Get tedall/_mapping/

Get tedindi/_mapping

GET /_search
{
    "query": {
        "match_all": {}
    }
}

PUT testsuball
{
    "title": ["The Arsstist", "Formerly known as Prince" ],
    "genres": ["Drama", "Comedy","ASD","SDF"]
 
}

POST testsuball/video
{
  "subscriberUserIDs": "kika",
  "title":"abcdef",
  "videoId":"abcdef",
  "script":"abcdef",
  "description":"abcdef"
}


Get testsuball/_search
{
  "query":{
     "bool": {
      "should": [
        { "multi_match": {
           "query":    "sigmoid activation function",
      "fields": [ "title", "description" , "script" ]
        }}
      ],
      "must":[
          { "match": { "subscriberUserIDs":  "UCvQgA_Q5G_hi7jc0ZE0nj5A" }}
        ]
    }
  }
}

GET /testsubindi/_stats


PUT /_snapshot/x
{
    "type": "fs",
    "settings": {
        "location": "/mount/backups",
        "compress": true
    }
}

PUT _snapshot/my_backup
{
    "type": "fs",
    "settings": {
        "location": "/mount/backups/my_backup"
    }
}

POST _snapshot/my_backup/
{
    "type": "fs",
    "settings": {
        "location": "/mount/backups/my_backup",
        "max_snapshot_bytes_per_sec" : "50mb",
        "max_restore_bytes_per_sec" : "50mb"
    }
}


PUT _snapshot/my_backup/x
{
    "indices": "testsuball"
}

Comments

Popular posts from this blog

Gui logging in node js and python

For node.js Use  frontail for logging https://www.npmjs.com/package/frontail For Python -- use Cutelog https://pypi.org/project/cutelog/ In NodeJs for using frontail we need to use log the logs in a file for logging logs to file , we will use winston Using winston https://www.npmjs.com/package/winston Eg. of using winstonconst { createLogger, format, transports } = require('winston'); const { combine, timestamp, label, prettyPrint } = format; const logger = createLogger({   level: 'info',   format: format.json(),   transports: [     //     // - Write to all logs with level `info` and below to `combined.log`      // - Write all logs error (and below) to `error.log`.     //     new transports.File({ filename: 'error.log', level: 'error' }),     new transports.File({ filename: 'combined.log' })   ] }); logger.log({   level: 'info',   message: 'What time is...

opening multiple ports tunnels ngrok in ubuntu

Location for the config yml file /home/example/.ngrok2/ngrok.yml content of config file authtoken: 4nq9771bPxe8ctg7LKr_2ClH7Y15Zqe4bWLWF9p tunnels: app-foo: addr: 80 proto: http host_header: app-foo.dev app-bar: addr: 80 proto: http host_header: app-bar.dev how to start ngrok with considering the config file: ngrok start --all

rename field in elastic Search

https://qiita.com/tkprof/items/e50368eb1473497a16d0 How to Rename an Elasticsearch field from columns: - {name: xxx, type: double} to columns: - {name: yyy, type: double} Pipeline API and reindex create a new Pipeline API : Rename Processor PUT _ingest/pipeline/pipeline_rename_xxx { "description" : "rename xxx", "processors" : [ { "rename": { "field": "xxx", "target_field": "yyy" } } ] } { "acknowledged": true } then reindex POST _reindex { "source": { "index": "source" }, "dest": { "index": "dest", "pipeline": "pipeline_rename_xxx" } }