• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


06 Feb, 2025

Updated at 10 Feb, 2025

The doucment is returned even if it does not meet the criteria

I use the following DSL query

"size": 25,
"query": {
	"bool": {
		"must": [
			{
				"term": {
					"hcAccountabilityOfficeCode.keyword": {
						"value": "550"
					}
				}
			},
			{
				"nested": {
					"query": {
						"term": {
							"hearingActionDetails.haaActionTypeCode.keyword": {
								"value": "SU"
							}
						}
					},
					"path": "hearingActionDetails",
					"ignore_unmapped": false,
					"score_mode": "none",
					"boost": 1.0
				}
			},
			{
				"nested": {
					"query": {
						"term": {
							"hearingActionDetails.haaActionCatCode.keyword": {
								"value": "A"
							}
						}
					},
					"path": "hearingActionDetails",
					"ignore_unmapped": false,
					"score_mode": "none",
					"boost": 1.0
				}
			},
			{
				"bool": {
					"must_not": [
						{
							"term": {
								"hcStatusCode.keyword": {
									"value": "STS54"
								}
							}
						}
					],
					"boost": 1.0
				}
			},
			{
				"nested": {
					"query": {
						"exists": {
							"field": "hearingActionDetails.haaReceivedOn",
							"boost": 1.0
						}
					},
					"path": "hearingActionDetails",
					"ignore_unmapped": false,
					"score_mode": "none",
					"boost": 1.0
				}
			},
			{
				"nested": {
					"query": {
						"bool": {
							"must_not": [
								{
									"exists": {
										"field": "hearingActionDetails.haaPartyRespRcvdOn",
										"boost": 1.0
									}
								}
							],
							"boost": 1.0
						}
					},
					"path": "hearingActionDetails",
					"ignore_unmapped": false,
					"score_mode": "none",
					"boost": 1.0
				}
			},
			{
				"nested": {
					"query": {
						"bool": {
							"must_not": [
								{
									"exists": {
										"field": "hearingActionDetails.haaPartyReplyRcvdOn",
										"boost": 1.0
									}
								}
							],
							"boost": 1.0
						}
					},
					"path": "hearingActionDetails",
					"ignore_unmapped": false,
					"score_mode": "none",
					"boost": 1.0
				}
			}
		],
		"boost": 1.0
	}
}

The following document is returned even though it does not meet the criteria specified in the query.
The query clearly defined for "must_not" for "hearingActionDetails.haaPartyRespRcvdOn" and "hearingActionDetails.haaPartyReplyRcvdOn"

{
	"hcHearingCaseId": 274,
	"hcCaseNumber": "550-2025-00005",
	"hcStatusCode": "STS11",
	"hcAccountabilityOfficeCode": "550",
	"hcAccountabilityOfficeDescription": "San Francisco District Office",
	"hearingActionDetails": [
		{
			"haaHearingActionId": 374,
			"haaActionCatId": 954,
			"haaActionCatCode": "A",
			"haaActionCatDesc": "Motions",
			"haaActionTypeId": 920,
			"haaActionTypeCode": "SU",
			"haaActionTypeDesc": "Summary Judgement",
			"haaActionStatusId": 971,
			"haaActionStatusCode": "C",
			"haaActionStatusDescription": "Granted in Full for Complainant",
			"haaReqPartyTypeId": 927,
			"haaReqPartyTypeCode": "C",
			"haaReqPartyTypeDesc": "Complainant",
			"haaSurReplyStatusId": null,
			"haaSurReplyStatusCode": null,
			"haaSurReplyStatusDescription": null,
			"haaSurReplySubById": null,
			"haaSurReplySubByCode": null,
			"haaSurReplyReqByDescription": null,
			"haaReceivedOn": "01-03-2025",
			"haaPartyRespDueSetOn": null,
			"haaPartyRespDueOn": "01-21-2025",
			"haaPartyRespRcvdOn": "01-03-2025",
			"haaPartyReplyDueOn": "01-08-2025",
			"haaPartyReplyRcvdOn": "01-03-2025",
			"haaRespRcvdFrmAgcyOn": null,
			"haaRespRcvdFrmCompOn": null,
			"haaSurReplySubOn": null,
			"haaSurReplyRespDueOn": null,
			"haaSurReplyRespRcvdOn": null,
			"haaOrderDueOn": null,
			"haaIssuedOn": null,
			"haaRespRecdFrmAgcyOn": null,
			"haaRespRecdFrmCompOn": null,
			"hacCreatedOn": "01-03-2025",
			"hacMotionSurReplyRecdOn": null,
			"hacSurReplyStatusUpdatedOn": null
		}
	],
	"hcCaseAssigned": "N"
}

1 post - 1 participant

Read full topic