문제

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

도움이 되었습니까?

해결책

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));  
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top