Skip to content

Nest: Performing msearch does not add "ignoreUnavailable" #969

@philbarresi

Description

@philbarresi

When performing a multisearch like so:

            var results = await client.MultiSearchAsync(msd =>
            {
                 foreach(var entry in articles) {
                    msd = msd.Search<Article>(entry.Id, sd => sd
                        .Indices(indices)
                        .IgnoreUnavailable(); // other query stuff here
                 }
             }

The raw request, according to Fiddler, is:

POST http://10.211.55.3:9200/_msearch HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Basic
Host: 10.211.55.3:9200
Content-Length: 612

{"index":"index1,index2","type":"articleType"}
{myqueryhere}

I have verified independently that the search query works when pointed at an index or set of indices that exists, and so have omitted some details as this is a work related project. The only issue is that the first line of the request should be:

{"index":"index1,index2","type":"articleType", "ignoreUnavailable": true}

Which allows the multisearch to complete successfully.

I have looked at the repository and attempted to fix this issue myself, but I am woefully in over my head.

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