Skip to content

Instantly share code, notes, and snippets.

{
status: 500,
statusText: 'Internal Server Error',
headers: {
date: 'Tue, 22 Oct 2024 11:05:10 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '876',
connection: 'keep-alive',
'x-powered-by': 'Express',
'access-control-allow-origin': '*',
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 '{