nest

NEST2 initialization on .NET C# WebAPI

﹥>﹥吖頭↗ 提交于 2019-12-25 03:59:27
问题 I defined the NEST2 client dependencies like this: container.RegisterType<IElasticClient, ElasticClient>( new InjectionConstructor( new ResolvedParameter<IConnectionSettingsValues>(), new OptionalParameter<IConnection>(), new OptionalParameter<IElasticsearchSerializer>(), new OptionalParameter<ITransport>())); I was using NEST and ElasticSearch. Now I moved to NEST 2 and ElasticSearch 2 and I had to change INestSerializer into IElasticsearchSerializer Unfortunately now I've got this error on

Ignoring case for elision step of french analyzer

社会主义新天地 提交于 2019-12-25 03:39:26
问题 ElasticSearch Nest seems to be missing the elision articles_case flag as discussed in this question: ArticleCase missing from nest elision filter? I noticed the official French analyzer has a lowercase filter immediately after the french_elision filter like so: "analyzer": { "rebuilt_french": { "tokenizer": "standard", "filter": [ "french_elision", // <==== Has the ignore case property set "lowercase", "french_stop", "french_keywords", "french_stemmer" ] } } Could I placed the lowercase step

How to add settings property with array value to ES-index using Nest

本小妞迷上赌 提交于 2019-12-25 03:04:42
问题 "I'm trying to create in index for auto complete seach using ElasticSearch and its NEST .NET client. I'm following the tutorial on http://qbox.io/blog/an-introduction-to-ngrams-in-elasticsearch and have run into problems when creating the index and its settings. Sepcifically I would like to create the index with the following settings (taken straight out of the tutorial's TL;DR, to begin with): PUT /test_index { "settings": { "analysis": { "filter": { "edge_ngram_filter": { "type": "edge

How to add settings property with array value to ES-index using Nest

☆樱花仙子☆ 提交于 2019-12-25 03:04:08
问题 "I'm trying to create in index for auto complete seach using ElasticSearch and its NEST .NET client. I'm following the tutorial on http://qbox.io/blog/an-introduction-to-ngrams-in-elasticsearch and have run into problems when creating the index and its settings. Sepcifically I would like to create the index with the following settings (taken straight out of the tutorial's TL;DR, to begin with): PUT /test_index { "settings": { "analysis": { "filter": { "edge_ngram_filter": { "type": "edge

NEST 1.0: See request on Fiddler

徘徊边缘 提交于 2019-12-24 23:17:54
问题 I just updated to NEST 1.0, I have Elastic Search on a remote server (not localhost then) and usually I had no problems seeing the request being sent and received by using Fiddler. After the update, bammm, no requests detected but they are being made without a problem by my app. Do you have any idea of what it is happening? Thanks, David 回答1: Automatic proxy detection is disabled by default in 1.0. You need to enable it: var settings = new ConnectionSettings(...)

Elastic Search: Query string and number not always returning wanted result

浪子不回头ぞ 提交于 2019-12-24 22:03:58
问题 We have an elastic search 5.5 setup. We use nest to perform our queries through C#. When executing the following query: { "query": { "bool": { "must": [ { "query_string": { "query": "00917751" } } ] } } } We get the desired result: one result with that the number as identifier. When executing the query: { "query": { "bool": { "must": [ { "query_string": { "query": "917751" } } ] } } } We get no results. The value we are searching for is in the field searchIndentifier, and has the value "1

How to build a unit test expected query for Nest 6.x with nested values

北战南征 提交于 2019-12-24 20:55:00
问题 This is a follow up question for another post which I had asked (and been answer) how to build a unit test to a specific query in ElasticSearch using Nest (in c#). this is a code sample from the answer which I was given in which I build an expected query for "normal" tags: var expected = new { query = new { @bool = new { must = new object[] { new { @bool = new { should = new object[] { new { match = new { title = new { query = "Kibana" } } }, new { match = new { title = new { query =

ElasticSearch - Auto mapping

末鹿安然 提交于 2019-12-24 18:23:39
问题 So recently I started working on ES and I thought of upgrading the current ElasticSearch.Net and Nest versions from 1.x to 5.x. I have noticed several changes. My question is about the auto mapping functionality in the latest version. Earlier I had attributes for each property. Say for example: [ElasticProperty(Name = "age", Type = FieldType.Integer)] public int Age { get; set; } But in the newer version, I could do something like [Number(NumberType.Integer, Name = "age")] public int Age {

Unable to fetch _source dictionary key-val from elastic client search response

落爺英雄遲暮 提交于 2019-12-24 18:13:32
问题 I am trying to access the hits _source dictionary to load into a db. hits returns null, what am I doing wrong ? Notes: searchResponse is returned with the JSON data, and the debuginformation confirms it. However, the Hit and the _Source class and the underlying data variables are not accessible and variable hits returns null. The below code of the local variable in debug mode shows the data. If needed then I can include more data or an image of the local variables or debug information window

Nest and Elastic Search - Mapping

三世轮回 提交于 2019-12-24 17:44:15
问题 I am trying to map multiple analyzers to a field in my elastic type. If I use an ElasticAttribute to map an analyzer: [ElasticProperty(Analyzer = "fulltext")] public string LongDescription { get; set; } and I look at the request created I get: "name": { "type": "string", "analyzer": "fulltext" }, In order to map multiple analyzers to the same field, I use Fluent mapping and add a multifield: .Properties(prop => prop .MultiField(mf => mf .Name(p => p.Name) .Fields(f => f .String( s => s.Name(n