我一直在使用query_string來過濾出結果。現在的問題是,當我嘗試使用查詢字符串作爲「我愛我的工作和我的老闆」彈性搜索治療和作爲運營商和我的結果出錯。在query_param彈性搜索中使用AND的問題
但是,在這種情況下,AND不是運營商。
如何判斷AND不是運算符及其對elasticsearch的字符串。任何解決這個問題的方法都會有很大的幫助。
在此先感謝。
EDIT-1 (QUERY_STRING)
{
"_source": ["customer.ezPayId", "customer.billingContact.name", "customer.serviceContact.name", "customer.wmMetaData.library"],
"query": {
"bool": {
"must_not": [{
"term": {
"customer.lob": {
"value": "residential"
}
}
}],
"should": [{
"query_string": {
"query": "ROCHESTER GAS AND ELECTRIC"
}
},
{
"regexp": {
"customer.serviceContact.name_ivr": "ROCHESTER GAS AND ELECTRIC<0-999>"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": "ROCHESTER GAS AND ELECTRIC<0-999>"
}
}, {
"regexp": {
"customer.serviceContact.name_ivr": ".<0-999>ROCHESTER GAS AND ELECTRIC"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": ".<0-999>ROCHESTER GAS AND ELECTRIC"
}
}, {
"regexp": {
"customer.serviceContact.name_ivr": "ROCHESTER GAS AND ELECTRIC[0-9-',(/)@%#&*$!^+_|]"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": "ROCHESTER GAS AND ELECTRIC[0-9-',(/)@%#&*$!^+_|]"
}
}]
}
},
"filter": {
"or": [{
{
"term": {
"customer.billingContact.name_ivr": "ROCHESTER GAS AND ELECTRIC"
}
}, {
"term": {
"customer.serviceContact.name_ivr": "ROCHESTER GAS AND ELECTRIC"
}
}, {
"regexp": {
"customer.serviceContact.name_ivr": "ROCHESTER GAS AND ELECTRIC<0-999>"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": "ROCHESTER GAS AND ELECTRIC<0-999>"
}
}, {
"regexp": {
"customer.serviceContact.name_ivr": ".<0-999>ROCHESTER GAS AND ELECTRIC"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": ".<0-999>ROCHESTER GAS AND ELECTRIC"
}
}, {
"regexp": {
"customer.serviceContact.name_ivr": "[0-9-',(/)@%#&*$!^+_| ].+ROCHESTER GAS AND ELECTRIC"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": "[0-9-',(/)@%#&*$!^+_| ].+ROCHESTER GAS AND ELECTRIC"
}
}, {
"regexp": {
"customer.serviceContact.name_ivr": "ROCHESTER GAS AND ELECTRIC[0-9-',(/)@%#&*$!^+_| ].+"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": "ROCHESTER GAS AND ELECTRIC[0-9-',(/)@%#&*$!^+_| ].+"
}
}, {
"regexp": {
"customer.serviceContact.name_ivr": "(.*) ROCHESTER GAS AND ELECTRIC (.*)"
}
}, {
"regexp": {
"customer.billingContact.name_ivr": "(.*) ROCHESTER GAS AND ELECTRIC (.*)"
}
}]
}
}
顯示完整的查詢 –
你需要與運營商爲其他搜索? –
@MithileshGupta:我用查詢字符串編輯了我的帖子。請看看它。 –