本文主要是介绍【无标题】es搜索基本操作,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一,准备数据
1.创建索引
PUT /lagou-book/
2.创建mapping
PUT /lagou-book/doc/_mapping
{"properties":{"description":{"type":"text","analyzer":"ik_max_word"},"name":{"type":"text","analyzer":"ik_max_word"},"price":{"type":"float"},"timestamp":{"type":"date","format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"}}
}
3.数据准备
PUT /lagou-book/doc/1
{
"name": "lucene",
"description": "Lucene Core is a Java library providing powerful indexing",
"price":100.45,
"timestamp":"2020-08-21 19:11:35"
}PUT /lagou-book/doc/2
{
"name": "solr",
"description":
这篇关于【无标题】es搜索基本操作的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!