elastic-rs / elastic

An Elasticsearch REST API client for Rust
Apache License 2.0
253 stars 40 forks source link

HitsTotal Mapping Error #373

Closed jatsrt closed 5 years ago

jatsrt commented 5 years ago

Not sure what the change is, but getting this in preview 5/master, looks like the mapping changed for the type and is not correct:

ClientError {
        inner: Error(
            Response(
                200,
            ),
            State {
                next_error: Some(
                    Parse(
                        ParseError {
                            inner: Error("invalid type: number, expected struct HitsTotal", line: 1, column: 107),
                        },
                    ),
                ),
                backtrace: None,
            },
        ),
jatsrt commented 5 years ago

Looks like a 7.x AIP change that's not compatible with 6.x

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-track-total-hits.html

jatsrt commented 5 years ago

Will close this for now, but something to think on. With elasticsearch you generally have two major versions in play at any given time. Right now v 6.x is "production" for most/many organizations, while 7.x is the emerging version.

Example of how this is managed from another project: https://olivere.github.io/elastic/

Not easy for sure.

GopherJ commented 5 years ago

@jatsrt hello, so if I still use elasticsearch@5.6.16, is there a way to use elastic-rs?

jatsrt commented 5 years ago

Not currently as it is only kept up to date with the latest elastic mappings, which is currently at 7.x. I personally am still on 6.x and have a branch I maintain where I fix what is needed to keep it working right.