nest

ElasticSearch analyzed fields

落爺英雄遲暮 提交于 2019-12-24 11:58:27
问题 I'm building my search but need to analyze 1 field with different analyzers. My problem is for a field I need to have an analyzer on it for stemming (snowball) and then also one to keep the full word as one token (keyword). I can get this to work by the following index settings: curl -X PUT "http://localhost:9200/$IndexName/" -d '{ "settings":{ "analysis":{ "analyzer":{ "analyzer1":{ "type":"custom", "tokenizer":"keyword", "filter":[ "standard", "lowercase", "stop", "snowball", "my_synonyms"

How to use multiple index analyzers in NEST?

会有一股神秘感。 提交于 2019-12-24 11:08:31
问题 I have a Company type I've created. Inside of that Company type I have a field called "Summary". How can I add multiple index analyzers to this field? I briefly looked into using the Yakaz plugin, but it doesn't appear I can use that with NEST. The reasoning behind this is that sometimes users will search for company names with a period in their query, other times they won't include the period. I'd like to do a partial match using ngrams on both the company name with and without punctuation.

Bulk Indexing in Elasticssearch using the ElasticLowLevelClient client

独自空忆成欢 提交于 2019-12-24 06:24:08
问题 I'm using the ElasticLowLevelClient client to index elasticsearch data as it needs to be indexed as a raw string as I don't have access to the POCO objects. I can successfully index an individual object by calling: client.Index<object>(indexName, message.MessageType, message.Id, new Elasticsearch.Net.PostData<object>(message.MessageJson)); How can I do a bulk insert into the index using the ElasticLowLevelClient client? The bulk inset APIs all require a POCO of the indexing document which I

ElasticSearch NEST term query returns no results

泪湿孤枕 提交于 2019-12-24 04:32:57
问题 Here my schema [ElasticType(Name = "importFile")] public class ImportFile : DocumentMapping { [ElasticProperty(Store = false, Index = FieldIndexOption.NotAnalyzed)] public string FileName { get; set; } [ElasticProperty(Store = false, Index = FieldIndexOption.NotAnalyzed)] public string GroupId { get; set; } [ElasticProperty(Store = false, Index = FieldIndexOption.Analyzed)] public string FilePath { get; set; } } I made a NEST query like this one: var res = ElasticClient.Search<ImportFile>(s =

Serialization error with Elasticsearch NEST/C#

故事扮演 提交于 2019-12-24 03:08:40
问题 I'm using NEST to index my objects and I'm running into a Newtonsoft error on serialization. One of my objects has a self referencing loop. Would there be a way for me to access the JsonSerializer and change how it handles self-references without having to modify the source code? 回答1: You can register custom converters on your client: public void AddConverter(JsonConverter converter) { this.IndexSerializationSettings.Converters.Add(converter); this.SerializationSettings.Converters.Add

In ElasticSearch(Nest), Can't specify parent if no parent field has been configured

两盒软妹~` 提交于 2019-12-24 01:06:16
问题 I am using Nest Client to communicate with ElasticSearch. When i trying to index child type it is giving me error in the heading. I have already set this attribute on Parent Type : [ElasticType(Name ="item", IdProperty = "id")]. This should tell elastic type about id field. Below is the query made by nest with error info. {StatusCode: 400, Method: PUT, Url: http://localhost:9200/itemindex/inventory/15894?routing=15894&parent=15894, Request: { "itemId": 15894, "inventories": [ { "storeId":

ElasticSearch NEST: Create an index through ElasticClient by specifying json

守給你的承諾、 提交于 2019-12-23 10:15:58
问题 We allow the client to define custom analyzers at the time they create an index. We would prefer to specify this in json to provide maximum flexibility and understandability via the underlying ElasticSearch documentation. I would like to create an index using an arbitrary description of analyzers, mappers, etc., defined in a json string. Using sense, my command is PUT /my_index { "settings": { "analysis": { "char_filter" : { "my_mapping" : { "type" : "mapping", "mappings" : [".=>,", "'=>,"] }

ElasticSearch - NEST Query Condition Limit

∥☆過路亽.° 提交于 2019-12-23 05:29:34
问题 After searching on Google, i found the Elasticsearch max query condition limit is 1024? Is it configurable? If yes can you anyone please provide the steps. Thanks, Sameer 回答1: Default value is 1024, but it is configurable. In the elasticsearch configuration file (the yml file for example), set the mentioned setting: index.query.bool.max_clause_count: 100000 for example. 来源: https://stackoverflow.com/questions/28637004/elasticsearch-nest-query-condition-limit

How to store a c# List of objects into ElasticSearch with NEST 2.x

橙三吉。 提交于 2019-12-23 03:24:11
问题 I'm developing a cross-platform app with xamarin.forms and I'm trying to look for a way to store a List of Objects directly into ElasticSearch so I can later search for results based on the objects of the lists. My scenario is the folloring: public class Box { [String(Index = FieldIndexOption.NotAnalyzed)] public string id { get; set; } public List<Category> categories { get; set; } } public class Category { [String(Index = FieldIndexOption.NotAnalyzed)] public string id { get; set; } public

How to make an accent insensitive search in elasticsearch with nest c# client?

家住魔仙堡 提交于 2019-12-23 02:36:20
问题 I'm an elasticsearch newbie. Lets say we have a class like this: public class A { public string name; } And we have 2 documents which have names like "Ayşe" and "Ayse" . Now, I want to be able to store names with their accents but when I search want to be able take results of accent insensitive query as accent sensitive results . For ex: When I search for "Ayse" or "Ayşe" , it should return both "Ayşe" and "Ayse" as they stored (with accent). Right now when I search for "Ayse" it only returns