當前位置: 首頁>>代碼示例>>C#>>正文


C# ConnectionSettings.DefaultIndex方法代碼示例

本文整理匯總了C#中Nest.ConnectionSettings.DefaultIndex方法的典型用法代碼示例。如果您正苦於以下問題:C# ConnectionSettings.DefaultIndex方法的具體用法?C# ConnectionSettings.DefaultIndex怎麽用?C# ConnectionSettings.DefaultIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nest.ConnectionSettings的用法示例。


在下文中一共展示了ConnectionSettings.DefaultIndex方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetClient

 public static IElasticClient GetClient()
 {
     var node = new Uri("http://localhost:9200");
     var settings = new ConnectionSettings(node);
     settings.DefaultIndex("stackoverflow");
     return new ElasticClient(settings);
 }
開發者ID:rseniuta,項目名稱:elasticsearch-nest-webapi-angularjs,代碼行數:7,代碼來源:ElasticConfig.cs

示例2: ElasticSearchDataProvider

 public ElasticSearchDataProvider(string connectionString)
 {
     var settings = new ConnectionSettings(new Uri(connectionString));
     settings.DefaultIndex(DEFAULT_INDEX);
     _client = new ElasticClient(settings);
     Initialize();
 }
開發者ID:aluitink,項目名稱:stockpile,代碼行數:7,代碼來源:ElasticSearchDataProvider.cs

示例3: DefaultSettings

		private static ConnectionSettings DefaultSettings(ConnectionSettings settings) => settings
			.DefaultIndex("default-index")
			.PrettyJson()
			.InferMappingFor<Project>(map => map
				.IndexName("project")
				.IdProperty(p => p.Name)
			)
			.InferMappingFor<CommitActivity>(map => map
				.IndexName("project")
				.TypeName("commits")
			)
			.InferMappingFor<Developer>(map => map
				.IndexName("devs")
				.Ignore(p => p.PrivateValue)
				.Rename(p => p.OnlineHandle, "nickname")
			)
			.InferMappingFor<PercolatedQuery>(map => map
				.IndexName("queries")
				.TypeName(PercolatorType)
			)
			//.EnableTcpKeepAlive(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(2))
			//.PrettyJson()
			//TODO make this random
			//.EnableHttpCompression()

			.OnRequestDataCreated(data=> data.Headers.Add("TestMethod", ExpensiveTestNameForIntegrationTests()));
開發者ID:niemyjski,項目名稱:elasticsearch-net,代碼行數:26,代碼來源:TestClient.cs

示例4: SalusElasticSearch

        public SalusElasticSearch()
        {
            var node = new Uri("http://localhost:9200");
            var settings = new ConnectionSettings(node);
            settings.DefaultIndex("my-application");

            this.client = new ElasticClient(settings);
        }
開發者ID:tbrito,項目名稱:salus,代碼行數:8,代碼來源:SalusElasticSearch.cs

示例5: SearchService

        public SearchService(IConfiguration configuration)
        {
            var connectionString = new Uri(configuration["Search:Url"]);
            var indexName = configuration["Search:IndexName"];

            var settings = new ConnectionSettings(connectionString);
            settings.DefaultIndex(indexName);

            _client = new ElasticClient(settings);
        }
開發者ID:ucdavis,項目名稱:Namster,代碼行數:10,代碼來源:SearchService.cs

示例6: SearchProvider

        public SearchProvider()
        {
            esNode = new Uri("http://localhost:9200");
            esSettings = new ConnectionSettings(esNode);
            esSettings.DefaultIndex(def_index);
            esClient = new ElasticClient(esSettings);

            //Shownig Elastic info in Console
            //Console.WriteLine(esClient.NodesInfo().ToString());
            //Console.ReadKey();
        }
開發者ID:ldlarsed,項目名稱:WebAPI_Elasticsearch_NEST-ASP.NET,代碼行數:11,代碼來源:SearchProvider.cs

示例7: DefaultSettings

		private static ConnectionSettings DefaultSettings(ConnectionSettings settings) => settings
			.DefaultIndex("default-index")
			.PrettyJson()
			.InferMappingFor<Project>(map => map
				.IndexName("project")
				.IdProperty(p => p.Name)
			)
			.InferMappingFor<CommitActivity>(map => map
				.IndexName("project")
				.TypeName("commits")
			)
			.InferMappingFor<Developer>(map => map
				.IndexName("devs")
				.Ignore(p => p.PrivateValue)
				.Rename(p => p.OnlineHandle, "nickname")
			)
			//We try and fetch the test name during integration tests when running fiddler to send the name 
			//as the TestMethod header, this allows us to quickly identify which test sent which request
			.GlobalHeaders(new NameValueCollection
			{
				{ "TestMethod", ExpensiveTestNameForIntegrationTests() }
			});
開發者ID:cusi-dev,項目名稱:elasticsearch-net,代碼行數:22,代碼來源:TestClient.cs

示例8: ElasticSearchSetup

        // Create index for filling data
        // @indexName : whatever
        public void ElasticSearchSetup(string indexName)
        {
            Uri node = new Uri(ElasticServer);
            ConnectionSettings settings = new ConnectionSettings(node);
            settings.DefaultIndex(indexName);
            client = new ElasticClient(settings);

            // create the index if it doesn't exist
            if (!client.IndexExists(indexName).Exists)
            {
                client.CreateIndex(indexName);
            }
        }
開發者ID:HrTran,項目名稱:InternInfoRe,代碼行數:15,代碼來源:IndexingPageRank.cs


注:本文中的Nest.ConnectionSettings.DefaultIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。