Writing queries with Search UI

Hello all,

I am currently researching the best way to send complex queries from a front-end interface to a custom api which will then send the query to Elasticsearch (using search UI-ES-connector).

Search UI seems the best fit however, I have a hard time seeing how could I translate the queries I am sending to Elasticsearch into React.js. Most queries sent to ES contains filters, aggregations, sub-aggs, nested aggs and even reverse aggs. I wonder if it's even doable and that perhaps it should be done separately. Any feedback would be appreciated, thank you for your time. Here is one of the queries:

{
	"size": 0,
	"query": {
		"bool": {
			"filter": [
				{
					"exists": {
						"field": "numero"
					}
				},
				{
					"range": {
						"status": {
							"gte": "7",
							"lte": "8"
						}
					}
				}
			]
		}
	},
	"aggs": {
		"OT": {
			"terms": {
				"field": "status",
				"missing": "-1"
			},
			"aggs": {
				"DATE": {
					"date_histogram": {
						"field": "completed_date"
					},
					"aggs": {
						"type_id": {
							"terms": {
								"field": "type_id",
								"missing": "-1",
								"size": 100
							}
						},
						"hierarchy": {
							"terms": {
								"field": "hierarchy",
								"missing": "N/A",
								"size": 100
							}
						},
						"empl_id": {
							"terms": {
								"field": "empl_id",
								"missing": "-1",
								"size": 100
							}
						}
					}
				}
			}
		}
	}
}

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