当前位置: 首页>>代码示例>>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;未经允许,请勿转载。