How can I see the NEST.SearchRequest.Type property's effect on my ElasticSearch Query -


i'm attempting query dynamic list of types in elasticsearch index using nest searchrequest object.

public object search(object runtimedata) {   var request = new searchrequest()     {       = 0,       size = 10     };    request = setrouting(request, runtimedata);   request = setindices(request, runtimedata);   request = settypes(request, runtimedata);   request = setquery(request, runtimedata);   ...   var results = _searchclient.search<baseofalltypes>(request);   return results; } ... private searchrequest settypes(searchrequest request, object runtimedata) {   request.types = gettypesforruntime(runtimedata); } 

if call system.text.encoding.utf8.getstring(_searchclient.serializer.serialize(request)) through debugger on line perform search, don't see relevant types in json:

{   "from": 0,   "size": 10,   "query": {     "bool": {       "must": [         {           "simple_query_string": {             "query": "my query data here",             "default_operator": "and"           }         }       ]     }   } } 

the query results come though types being filtered, however. running generated json directly through elasticsearch-head returns results types, seems though there's i'm not seeing in serialization of request ought see.

the "types" present in http request header. you're seeing http request body. request header, use

var requestheader = results.connectionstatus.requesturl; 

you'll cluster address , index name information along type information.

beware, works when search() operation succeeds. otherwise results can potentially null , statement throw npe.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -