Help With Query String Query on Nested Fields

Hello,

Here is my Schema,

{
	"cmslocal": {
		"mappings": {
			"video": {
				"properties": {
					"assetProps": {
						"properties": {
							"assetType": {
								"type": "string"
							},
							"configPath": {
								"type": "string",
								"fields": {
									"raw": {
										"type": "string",
										"index": "not_analyzed"
									}
								},
								"analyzer": "standard"
							},
							"contentSha1": {
								"type": "string"
							},
							"originalPath": {
								"type": "string",
								"fields": {
									"raw": {
										"type": "string",
										"index": "not_analyzed"
									}
								},
								"analyzer": "standard"
							},
							"path": {
								"type": "string",
								"fields": {
									"raw": {
										"type": "string",
										"index": "not_analyzed"
									}
								},
								"analyzer": "standard"
							},
							"thumbnailPath": {
								"type": "string",
								"fields": {
									"raw": {
										"type": "string",
										"index": "not_analyzed"
									}
								},
								"analyzer": "standard"
							}
						}
					},
					"channel": {
						"type": "string"
					},
					"configProps": {
						"properties": {
							"events": {
								"type": "nested",
								"include_in_root": true,
								"properties": {
									"Desc": {
										"type": "string"
									},
									"Tags": {
										"type": "string"
									},
									"UUID": {
										"type": "string"
									}
								}
							},
							"roiUUID": {
								"type": "string"
							}
						}
					},
					"contentSha1": {
						"type": "string"
					},
					"eventDesc": {
						"type": "string"
					},
					"ext": {
						"type": "string"
					},
					"format": {
						"type": "string"
					},
					"fovProps": {
						"properties": {
							"description": {
								"type": "string"
							},
							"width": {
								"type": "float"
							}
						}
					},
					"locationProps": {
						"type": "nested",
						"properties": {
							"address": {
								"type": "string"
							},
							"city": {
								"type": "string"
							},
							"country": {
								"type": "string"
							},
							"county": {
								"type": "string"
							},
							"location": {
								"type": "geo_point"
							},
							"postcode": {
								"type": "string"
							},
							"state": {
								"type": "string"
							}
						}
					},
					"nodeid": {
						"type": "string"
					},
					"poleHeight": {
						"type": "float"
					},
					"query": {
						"properties": {
							"bool": {
								"properties": {
									"filter": {
										"properties": {
											"term": {
												"properties": {
													"nodeid": {
														"type": "string"
													}
												}
											}
										}
									}
								}
							}
						}
					},
					"retentionPolicy": {
						"type": "string"
					},
					"siteScopeID": {
						"type": "string"
					},
					"tagProps": {
						"type": "nested",
						"properties": {
							"conditions": {
								"type": "string"
							},
							"environment": {
								"type": "string"
							},
							"events": {
								"type": "string"
							},
							"lighting": {
								"type": "string"
							},
							"objects": {
								"type": "string"
							},
							"other": {
								"type": "string"
							},
							"scenes": {
								"type": "string"
							},
							"useCases": {
								"type": "string"
							},
							"weather": {
								"type": "string"
							}
						}
					},
					"test": {
						"type": "string"
					},
					"title": {
						"type": "string"
					},
					"uploadTime": {
						"type": "date",
						"format": "strict_date_optional_time||epoch_millis"
					},
					"videoProps": {
						"properties": {
							"bitrate": {
								"type": "float"
							},
							"datetime": {
								"type": "date",
								"format": "date_hour_minute_second_millis"
							},
							"daySegments": {
								"type": "string"
							},
							"duration": {
								"type": "long"
							},
							"framerate": {
								"type": "float"
							},
							"height": {
								"type": "integer"
							},
							"overlaysOn": {
								"type": "boolean"
							},
							"width": {
								"type": "integer"
							}
						}
					}
				}
			}
		}
	}
}

Here is the Sample Record,

 {
            "assetProps": {
                "contentSha1": "236c266d1ed430da8469916a915e319392df3929",
                "assetType": "raw",
                "path": "249b7f98-e875-4737-92fb-50bda25c6818",
                "originalPath": "",
                "configPath": "",
                "thumbnailPath": "3fac0e2f-7cbe-4e30-bb4e-121115c5e215"
            },
            "tagProps": {
                "conditions": ["snow","rain","fire"],
                "objects": ["car","crowd","people"],
                "other": [
                    "VaticVideos",
                    "corrected by Tamas Balyi"
                ],
                "scenes": [],
                "useCases": []
            },
            "format": "application/octet-stream",
            "fovProps": {
                "width": 0
            },
            "nodeid": "N02cff165",
        }

I could able to do a search on nodeid with an OR operator but the issue is with the nested fields.

here is how I'm doing a nodeId query string.

 {
    "query": {
        "query_string": {
            "query": "N02cff165 OR N02cff130",
            "fields": [
                "nodeid"
             ]
        }
    }
}

How to I apply the query to get something like this.

"N02cff165 OR N02cff130 AND tagProps.objects = car AND tagProps.objects = people AND tagProps.conditons = snow OR tagProps.conditons = fire.

Does elastics search support Query string on nested objects ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.