Skip to content

Expected struct HitsTotal (pre-release) #410

@brigand

Description

@brigand

This seems closely related to #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).

  • 0.21.0-pre.2 ☑️ Good
  • 0.21.0-pre.3 ☑️ Good
  • 0.21.0-pre.4 ☑️ Good
  • 0.21.0-pre.5 ❌ Regression
(Parse(ParseError { inner: Error(\"invalid type: integer `0`, expected struct HitsTotal\", line: 11, column: 16) }))
Relevant code
#[derive(Clone, Debug, Serialize, Deserialize, ElasticType)]
pub struct PortfolioIdListing {
    pub id: String,
    pub idlisting: types::IdListing,
}

let response = esc
    .search::<es_models::PortfolioIdListing>()
    .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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions