我有customeFiled,它是
的组合customFieldTypeId和值。 我的文档内容数据是这样的
对于CustomeField.combined,我想使用AND运算符进行搜索 我尝试过这样的东西(尝试过MatchQuery)。
如果我搜索查询"query": "58c35ebb-86e6-4b2f-a151-28b8ddd99919 Bangkok"
,
它给我的数据只有58c35ebb-86e6-4b2f-a151-28b8ddd99919
没有Bankok
?
我希望它返回所有同时具有58c35ebb-86e6-4b2f-a151-28b8ddd99919
和Bangkok
的匹配。
有什么建议我做错了吗?
{
"profile": true,"from": 0,"size": 15,"_source": [
"entity.names.fullName","entity.customFields","entity.names.caseId"
],"sort": [
{
"entity.caseStatistics.countCategoriesByUnresolvedResults.Sanctions": {
"order": "desc"
}
},{
"entity.outstandingactions": {
"order": "desc"
}
},{
"entity.modificationDateByUser.utcDateTime": {
"order": "desc"
}
},{
"entity.modifier.lastName": {
"order": "asc"
}
}
],"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"query_string": {
"fields": [
"entity.customFields.combined"
],"query": "58c35ebb-86e6-4b2f-a151-28b8ddd99919 Bangkok","default_operator": "AND"
}
}
]
}
}
]
}
}
}
返回结果:
{
"id": "f8fa6a8a-2d34-4d3b-aa4a-b9cbe87aa9a24","version": 0,"entity": {
"added": false,"customFields": [ {
"customFieldTypeId": "ab75e581-c31e-4b86-a81b-3f331f2ddcce","combined": "ab75e581-c31e-4b86-a81b-3f331f2ddcce|Andrew Wilson","value": "Andrew Wilson"
},{
"customFieldTypeId": "97d5f242-b689-473e-a4cc-4a6ddbd4aae3","combined": "97d5f242-b689-473e-a4cc-4a6ddbd4aae3|Canada,Square TEST","value": "Canada,Square TEST"
},{
"customFieldTypeId": "8ee59ec9-bf6d-4c9c-8528-882412a1ea1f","combined": "8ee59ec9-bf6d-4c9c-8528-882412a1ea1f|Migration","value": "Migration"
},{ "customFieldTypeId": "9af3ca31-56a1-4de9-a2f2-2308ba96c236","combined": "9af3ca31-56a1-4de9-a2f2-2308ba96c236|Santiago Del Estero,Argentina","value": "Santiago Del Estero,Argentina"
},{
"customFieldTypeId": "58c35ebb-86e6-4b2f-a151-28b8ddd99919","combined": "58c35ebb-86e6-4b2f-a151-28b8ddd99919|A-00193476","value": "A-00193476"
},{
"customFieldTypeId": "ebaff5a9-2a8a-494e-a7ec-0d667a46e433","combined": "ebaff5a9-2a8a-494e-a7ec-0d667a46e433|18672_Batch 2 Finance Current Cust.csv_1349201800270","value": "18672_Batch 2 Finance Current Cust.csv_1349201800270"
}
],"caseStatus": "SCREENED","modifier": {
"firstName": "USER_FIRST_97b1cf41-d2dd-494d-830f-753b66e84094","lastName": "USER_LAST_40fb3c30-5772-4f29-ab2a-d2958db2b272","id": "97e42eaf-5234-4f35-8a5c-21f29268da8e","version": 0
},"modifierId": "97e42eaf-5234-4f35-8a5c-21f29268da8e","nameTransposition": false,"ownerId": "312dacc6-9e71-4fe5-a0a5-db1d59d640ef","storableType": "NO_OPERATION","mediaCheckOgs": false,"noOperation": true,"watchlistResultCount": 0,"caseStatistics": {
"countReviewRequiredByProviderTypes": {
"WATCHLIST": 0,"PAsspORT_CHECK": 0,"MEDIA_CHECK": 0,"CLIENT_WATCHLIST": 0
},"totalResultsByProviderTypes": {
"WATCHLIST": 0,"countMandatoryactions": {
"TOTAL": 0,"TOTAL_UNRESOLVED": 0,"TOTAL_REVIEW_REQUIRED": 0
},"unresolvedResultsByProviderTypes": {
"WATCHLIST": 0,"clientWatchlistUnresolvedResults": 0,"countCategoriesByUnresolvedResults": {
"Other Bodies": 0,"Law Enforcement": 0,"PEP": 0,"Regulatory Enforcement": 0,"Sanctions": 0
},"countCategoriesByReviewRequiredResults": {
"Other Bodies": 0,"countMediaCheckAttachedArticle": 0
},"resultTermsMultiMap": {
"empty": true
},