1.以下是索引建立时的mapping
POST /ikanalyse
{
"settings": {},
"mappings": {
"fulltext": {
"_all": {
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word",
"term_vector": "no",
"store": "false"
},
"properties": {
"content": {
"type": "string",
"store": "no",
"term_vector": "with_positions_offsets",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word",
"include_in_all": "true",
"boost": 8
}
}
}
}
2 添加数据
POST /ikanalyse/fulltext/4
{"content":"中韩渔警冲突调查:韩警平均每天扣1艘中国渔船abcsader我来了1234.92,3你好,Ok"}
3 查询语句
POST /ikanalyse/fulltext/_search?pretty
{
"query": {
"bool": {"must": [
{
"term": {
"content":"1234"
}}
]}
}
}
但是查询无结果,我想达到的效果是搜索1234,或者abc,或者92都能将此文档搜索出来。请问大神们,可有办法实现啊,还请指教。谢谢
POST /ikanalyse
{
"settings": {},
"mappings": {
"fulltext": {
"_all": {
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word",
"term_vector": "no",
"store": "false"
},
"properties": {
"content": {
"type": "string",
"store": "no",
"term_vector": "with_positions_offsets",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word",
"include_in_all": "true",
"boost": 8
}
}
}
}
2 添加数据
POST /ikanalyse/fulltext/4
{"content":"中韩渔警冲突调查:韩警平均每天扣1艘中国渔船abcsader我来了1234.92,3你好,Ok"}
3 查询语句
POST /ikanalyse/fulltext/_search?pretty
{
"query": {
"bool": {"must": [
{
"term": {
"content":"1234"
}}
]}
}
}
但是查询无结果,我想达到的效果是搜索1234,或者abc,或者92都能将此文档搜索出来。请问大神们,可有办法实现啊,还请指教。谢谢
1 个回复
martindu - 搜披露创始人
赞同来自: