elasticsearch - Passing Aggregations to NEST using QueryRaw -


we trying pass aggregations through nest in raw format:

{ "query": {     "filtered": {         "query": {             "multi_match": {                 "query": "main",                 "type": "cross_fields",                 "fields": [                     "field1",                     "field2^5",                 ],                 "operator": "and"             }         }     } }, "aggregations": {     "multiselectterms": {         "terms": {             "field": "field1.raw",             "order": {                 "_count": "desc"             }         }     } } 

}

but when pass above json in nest not getting result. can please provide input how can pass aggregations in nest.

var uri = new uri(configurationmanager.appsettings["elasticsearch_server"]);         var settings = new connectionsettings(uri, defaultindex: configurationmanager.appsettings["indexname"]);         settings.enabletrace(true);         var client = new elasticclient(settings);         var resp=client.search<dynamic>(q =>             q.type("mappingtype").queryraw(reqobj["query"].tostring()).from(convert.toint32(((jvalue)reqobj["from"]))).size(convert.toint32(((jvalue)reqobj["size"])))             ); 

in response getting no data aggregations & hits.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -