我正在使用ElasticSearch(使用Tire gem)。我有以下查询,该查询将与escaped cat
,escaped black cat
等匹配
我想知道,是否有可能要求ElasticSearch使用以下标准进行搜索:
escaped \w{0,1} cat
escaped \w{n} cat
escaped (big|black|white) cat
当前搜索查询:
{
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "\"escaped ? cat\"",
"analyzer": "snowball"
}
},
{
"query_string": {
"query": "\"escaped ? cat\"",
"default_operator": "and"
}
},
{
"flt_field": {
"content": {
"like_text": "\"escaped ? cat\""
}
}
},
{
"mlt_field": {
"content": {
"like_text": "\"escaped ? cat\""
}
}
}
]
}
}
}
答案 0 :(得分:0)