c# - NEST Elasticsearch query value between 2 field names -


i want convert following sql query elasticsearch nest query:

select * table1 20 between minage , maxage 

so far nest query looks ("20" value client):

var result5 = client.search<person>(b => b         .filter(ff => ff                 .range(n => n                     .onfield(f => f.minage)                     .greater(20)                 )             )         .filter(ff => ff                 .range(n => n                     .onfield(f => f.maxage)                     .lower(???)  // how specify max value fieldname?                 )             ); 

   .filter(ff => ff             .range(n => n                 .onfield(f => f.minage)                 .greater(x)             ) && ff             .range(n => n                 .onfield(f => f.maxage)                 .lower(x)             )         ) 

in way have x -> between minage , maxage. x must greater minage , lower maxage in same time. hope helps!


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -