Skip to content

Instantly share code, notes, and snippets.

DELETE /thairath
PUT thairath
{
"settings": {
"analysis": {
"analyzer": {
"trigrams": {
"tokenizer": "trigram_tokenizer",
"filter": [
POST /test/product/_search
{
"query": {
"function_score": {
"query": { "match": { "name" : "การ์ดแสดงผล"} },
"functions": [
{
"filter": { "match": { "name": "ASUS" } },
"weight": 3
},
GET /test/_analyze?pretty
{
"analyzer" : "analyzer_shingle",
"text" : "วิรัช อยู่ยั่งยืน"
}
#!/bin/bash
# Tested with elasticsearch version 6.1.3
# Delete the existed one
curl -XDELETE localhost:9200/test?pretty
# Put new mapping
curl -XPUT localhost:9200/test?pretty -H 'Content-Type: application/json' -d '{
"settings": {
#!/bin/bash
# Tested with elasticsearch version 6.1.3
# Using ICU Analysis plugin, otherwise replace icu_tokenizer with thai in mapping part
# Delete the existed one
curl -XDELETE localhost:9200/test?pretty
# Put new mapping
curl -XPUT localhost:9200/test?pretty -H 'Content-Type: application/json' -d '{