elastic-rs / elastic

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

Expected struct HitsTotal (pre-release) #410

Open brigand opened 4 years ago

brigand commented 4 years ago

This seems closely related to https://github.com/elastic-rs/elastic/issues/377 but opening a new issues as that one is closed.

Getting "expected struct HitsTotal" issue with this on elasticsearch 6.7 (and the following versions for both elastic and elastic_derive crates).

(Parse(ParseError { inner: Error(\"invalid type: integer `0`, expected struct HitsTotal\", line: 11, column: 16) }))
Relevant code ```rust #[derive(Clone, Debug, Serialize, Deserialize, ElasticType)] pub struct PortfolioIdListing { pub id: String, pub idlisting: types::IdListing, } let response = esc .search::() .index(EsIndex::Portfolio.name()) .body(json!({ "query": { "bool": { "must": { // -1 is what the JS import script sets them to by default "term": { "pf_likes": -1 }, }, "must_not": { "terms": { "idlisting": exclude }, }, } }, "size": Value::Number(BATCH_SIZE.into()), "_source": ["id", "idlisting"] })) .send() ```