vinted / elasticsearch-dsl-rs

Strongly typed Elasticsearch DSL written in Rust
Apache License 2.0
198 stars 18 forks source link

Query builder return empty query instead of failing #257

Closed oknozor closed 4 months ago

oknozor commented 10 months ago

The following query get serialized to an empty string, I guess the function_score is skipped during serialization.

    let query = Query::bool().should(
        Query::function_score()
            .boost_mode(FunctionBoostMode::Replace)
            .function(
                Function::decay(
                    DecayFunction::Gauss,
                    "coord",
                    GeoLocation::new(0.0, 0.0),
                    Distance::Meters(5000),
                )
                .offset(Distance::Meters(1000))
                .weight(0.5)
                .decay(0.3),
            ),
    );

the output json:

{
  "bool": {}
}
buinauskas commented 10 months ago

Hello, thanks for the report, will check that real soon!

ernestas-vinted commented 4 months ago

Closing as the issue was resolved