In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, the editor will show you how to analyze the code of elasticsearch prefix matching. The knowledge points in the article are introduced in great detail. Friends who think it is helpful can browse the content of the article with the editor, hoping to help more friends who want to solve this problem to find the answer to the problem. Follow the editor to learn more about "how to analyze the code of elasticsearch prefix matching".
Curl-XDELETE 'http://localhost:9200/ess/';
Curl-XPOST 'http://localhost:9200/ess'-d' {
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edge_ngram"
"min_gram": 1
"max_gram": 20
"token_chars": ["whitespace"]
}
}
"analyzer": {
"autocomplete": {
"type": "custom"
"tokenizer": "whitespace"
"filter": [
"lowercase"
"autocomplete_filter"
]
}
"postsearch": {
"tokenizer": "keyword"
"filter": [
"lowercase"
]
}
}
}
}'
Curl-XPOST 'http://localhost:9200/ess/ess/_mapping'-d'
{
"ess": {
"properties": {
"id": {
"type": "long"
}
"fullname": {
"type": "string"
}
"allname": {
"type": "string"
"analyzer": "autocomplete"
"search_analyzer": "postsearch"
}
}
}
}'
Curl 'localhost:9200/ess/_analyze?pretty=1&analyzer=autocomplete'-d' zs zhangsan zsan zhangs Zhang San s zns'
Curl 'localhost:9200/ess/_analyze?pretty=1&analyzer=postsearch'-d 'Z'
Curl-XPOST http://localhost:9200/ess/ess/1-d'
{"fullname": "Zhang San", "allname": "zs zhangsan zsan zhangs Zhang San s zns"}
'
Curl-XPOST http://localhost:9200/ess/ess/2-d'
{"fullname": "Zhang Sanfeng", "allname": "zsf zhangsanfeng zsanfeng zhangsf Zhang Sanfeng Zhang sf znsf"}
'
Curl-XPOST http://localhost:9200/ess/ess/3-d'
{"fullname": "Li Sanfeng", "allname": "lsf lisanfeng lsanfeng lsf Li Sanfeng Li's lsf"}
'
Curl-XGET 'http://localhost:9200/ess/_search?pretty'-d' {
"query": {
"match": {
"allname": "Zhang S"
}
}
}'
Thank you for your reading, the above is the whole content of "how to analyze the code of elasticsearch prefix matching". Friends who learn to learn to do it quickly. I believe that the editor will certainly bring you better quality articles. Thank you for your support to the website!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.