Elasticsearch search query to retrieve all records NEST

前端 未结 2 753
轮回少年
轮回少年 2021-01-17 18:13

I have few documents in a folder and I want to check if all the documents in this folder are indexed or not. To do so, for each document name in the folder, I would like to

2条回答
  •  有刺的猬
    2021-01-17 19:00

    You can easily perform the following to get all records in index:

    var searchResponse = client.Search(s => s
                                        .Index("IndexName")
                                        .Query(q => q.MatchAll()
                                               )
                                         );
    
    var documents = searchResponse.Documents.Select(f => f.fieldName).ToList();
    

提交回复
热议问题