Skip to content

SearchDescriptor, Preference exception #389

@jjherbst

Description

@jjherbst

When specifying a preference on the query descriptor, it causes elasticsearch to throw an exception.

It seems that the preference is added to the body part of the query instead of the search parameters.

ElasticSeacrh code to re-produce

var result = elasticClient.Search<OrganizationProfile>(
    op=>op.Query(
            q=>q.Term(
                    t=>t.Profile.PersonalDetail.FirstName,"juan"
            )
    )
    .ExecuteOnPrimary()
    .Fields(field => field.Profile)
    .From(0)
    .Size(2)
);

Fiddler output (sent to ES):
{
"from": 0,
"size": 2,
"query": {
"term": {
"Profile.PersonalDetail.FirstName": {
"value": "juan"
}
}
},
"fields": [
"Profile"
],
"preference": "_primary"
}

Exception:
Parse Failure [No parser for element [preference]]]; }]

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