2

First of all: I am very new to Elasticsearch and the Nest API in specific.

I found that wonderful answer from Russ Cam concerning bulk Insert of documents: NEST ElasticClient C# bulk insert collection

I have two Questions:

  1. How is the bulk Delete of documents done in such a way.
  2. Is it possible to explicitly specify the index name instead of inferring it from the document type?

1 Answer 1

0

Try a Delete by Query. This allows you to construct a query and delete all documents that match it. And yes, you can specify the indices used by passing a string, as in this example:

var response = _client.DeleteByQuery<MyClass>(q => q
            .Query(q => q
                // your query here
            )
            .Index("Index_Name_Here")
        );
Sign up to request clarification or add additional context in comments.

1 Comment

Unfortunately that does not allow to delete a list of arbitrary documents.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.