GeoBoudingBox Multiple Query DSL

Hello,

I've got two points and i'd like in my request to define a boudingbox, and if one of those two points are in my rectangle.

Actually it work only with 1 points i've made few research to do multiple field request, like in the ES NEST documentation but it doesn't work for me.

Heres my request :

var searchResponse = client.LowLevel.Search<StringResponse>("jam", "jam", PostData.Serializable(new SearchDescriptor<Source>()
   .From(0)
   .Size(size)
    .Query(q => q
        .Bool(b => b                
            .Must(fi => fi
                .DateRange(r => r
                    .Field(f => f.Timestamp)
                    .GreaterThanOrEquals(limitDate)
                    .LessThan(DateTime.Now)
                ), mu => mu
            )
            .Filter(mu => mu
                 .GeoBoundingBox(ge => ge
                     .Field(f => f.Start)
                     .Field(f => f.End)
                     .BoundingBox(latLeft, lonLeft, latRight, lonRight)  
                 )
             )                           
         )
     )
 ));

The two points are f.Start & f.End, so in this exemple it will just return if the point .End correspond to the box.

To simplify id like a request that do :

( Time && (PointA || PointB) )

Atm it does :

( Time && PointA ) OR ( Time && PointB )

Thanks for your help, I hope its clear

Found it the answer is :

                        .Filter(mu => mu
                            .GeoBoundingBox(ge => ge
                                .Field(f => f.End)
                                .BoundingBox(latLeft, lonLeft, latRight, lonRight) 
                            ) || q
                            .GeoBoundingBox(ge => ge
                                .Field(f => f.Start)
                                .BoundingBox(latLeft, lonLeft, latRight, lonRight)
                            )

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