简体   繁体   中英

elasticsearch using NEST: document versioning

I am using the Search function in NEST to search documents based on a searching criteria. I get back result.DocumentsWithMetaData that displays a list of documents that has Version property null. Am I supposed to do something more in order to get the version back from ES?

Look at the integration test for it here: https://github.com/elastic/elasticsearch-net/blob/develop/src/Tests/Nest.Tests.Integration/Search/VersionTests.cs

You will have to call .Version() if you want version information to be returned.

var queryResults = ElasticClient.Search<MyDoc>(s => s
    .Version()
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM