File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -97,19 +97,19 @@ var tweet = new Tweet
9797 Message = " Trying out NEST, so far so good?"
9898};
9999
100- var response = client .Index (tweet );
100+ var response = client .Index (tweet , idx => idx . Index ( " mytweetindex " )); // or specify index via settings.DefaultIndex("mytweetindex" );
101101```
102102
103103All the calls have async variants:
104104
105105``` csharp
106- var response = client .IndexAsync (tweet ); // returns a Task<IndexResponse>
106+ var response = client .IndexAsync (tweet , idx => idx . Index ( " mytweetindex " ) ); // returns a Task<IndexResponse>
107107```
108108
109109### Getting a document
110110
111111``` csharp
112- var response = client .Get <Tweet >(1 ); // returns an IGetResponse mapped 1-to-1 with the Elasticsearch JSON response
112+ var response = client .Get <Tweet >(1 , idx => idx . Index ( " mytweetindex " ) ); // returns an IGetResponse mapped 1-to-1 with the Elasticsearch JSON response
113113var tweet = response .Source ; // the original document
114114```
115115
You can’t perform that action at this time.
0 commit comments