Question

I have authenticated a machine which hosts Elastic Search, using Jetty plugin. Everything works fine with respect to security. But my problem is I need to add documents / update documents in the same index which is secured using Jetty. In NEST I tried to find anything related to a method connecting uri(secured by jetty) with username and password to index my data. But no method or API helps out.

I need to know "Whether NEST supports, indexing Elastic Search secured by Jetty" and if answer is yes, then please tell how it can be done.

Thanks, PDK

Était-ce utile?

La solution

Can you try putting the username/password in the URI that you are using to connect to your Jetty secured Elasticsearch index.

 http://username:password@elasticsearchhost:9200

Since you are required to pass a Uri object to the ConnectionSettings for NEST you can set it like the following: (Updated 4/25/14 - reflect correct usage with Uri class.)

 var uri = new Uri("http://username:password@elasticsearchhost");
 var client = new ElasticClient(new ConnectionSettings(uri));  
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top