Query in Nest


(Paulo Henrique Ph) #1

Hi guys,

I'm trying to produce the request below in NEST.NET:
GET /INDEX/_search?q=DESCRIPTION:windowS

The problem is, the INDEX in question is a dynamic, therefore I won't be able to use it with a strongly typed FIELD as most of the documentation/articles says.

Any ideas?

I normally use the LowLevel client for aggregations, but for this search API I could not find a solution yet.

Cheers


(Paulo Henrique Ph) #2

This did the tric;k:

        var esResponse = Connection.Client.GetInstance().Search<DynamicResponse>(i => i.Index(physicalIndexName)
                                                                                       .Type(physicalIndexName)
                                                                                       .Query(q => q
                                                                                       .Match(m => m
                                                                                       .Field(**"FIELD NAME"**)
                                                                                       .Query(**FIELD VALUE**))));