nest

Specifying and using a NGramTokenizer with the C# NEST client for Elastic Search

泄露秘密 提交于 2019-12-21 04:43:04
问题 Updated to show a working sample I am trying to do a partial search on a collection of usernames in ElasticSearch. Searching around has pointed me in the nGram Tokenizer direction but I am stumped at proper implementation and fail to get any results. This is the the relevant code stripped from the project I'm working on. I have tried different combinations and search types to no avail. setup.cs var client = new ElasticClient(settings.ConnectionSettings); // (Try and) Setup the nGram tokenizer

Proper way to do multi field with NEST

為{幸葍}努か 提交于 2019-12-21 04:20:35
问题 I want to implement full text search and tokenized search with NEST, so I want to get multifield like that : "tweet": { "properties": { "message": { "type": "string", "store": true, "fields": { "raw": { "type": "string", "index": "not_analyzed" } } } } } Currently, my mapping with NEST is [ElasticType(Name = "tweet")] internal class Tweet { [ElasticProperty(Name = "message")] public string Message { get; set; } } I searched in the documentation on NEST and ElasticSearch.net but nothing came

Elasticsearch NEST - Filtering on multilevel nested types

坚强是说给别人听的谎言 提交于 2019-12-21 01:18:14
问题 I have a document model like this: "customer": { "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "orders": { "type": "nested", "properties": { "id": { "type": "integer" }, "orderDate" : { "type": "date", "format" : "YYYY-MM-dd" }, "orderLines": { "type": "nested", "properties": { "seqno": { "type": "integer" }, "quantity": { "type": "integer" }, "articleId": { "type": "integer" } } } } } } } A customer can have 0, 1 or multiple orders and an order can have 0, 1 or

ElasticSearch - Filtering the type

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 04:40:23
问题 I have upgraded my elasticsearch from v1.9 to v5 and I have noticed that a lot of things have changed. If I were to take an example from v1.9: The below code checks whether the object type matches ObjectAdo and it filters the items within ObjectAdo that have the IsDeleted field as false . private Func<FilterDescriptor<dynamic>, FilterContainer> Filter() { return b => b.Bool(x => x.Must(m => m.Type(typeof(ObjectAdo)), n => n.Term("IsDeleted", false))); } Now, after upgrading from v1.9 to v5, I

Is there a way to retrieve all records in a (ElasticSearch) NEST query? [duplicate]

*爱你&永不变心* 提交于 2019-12-19 17:45:39
问题 This question already has answers here : Elasticsearch query to return all records (26 answers) Closed 4 years ago . I'm doing this query in NEST var result = elasticClient.Search<SearchItemClass>( s=> s.Index("indexName") .Type("typeName") .Query(q => q.ConstantScore(score => score.Filter(f => f.Term("fieldName", "term")))) ); And this will return 10 Hits by default. Is there a way I can get ALL results, WITHOUT indicating .Size(value) or .Take(value)? Thanks in advance! 回答1: This is a dup

how to add a full phrase tokenizer in Nest for Elasticsearch?

烈酒焚心 提交于 2019-12-19 09:30:33
问题 when i create a search using facets, i want the facet results to be on the whole phrase, not the individual word. and i want it NOT to be case sensitive - as 'not_analyzed' would do. for example, if i have a music json object and want to organize the facet results based on genre, i want to see each genre as the whole genre term (rhythm and blues) and not one facet for 'rhythm' and one for 'blues', and i want to be able to search on 'rhythm and blues' and have it match 'Rhythm and Blues'

how to add a full phrase tokenizer in Nest for Elasticsearch?

扶醉桌前 提交于 2019-12-19 09:30:03
问题 when i create a search using facets, i want the facet results to be on the whole phrase, not the individual word. and i want it NOT to be case sensitive - as 'not_analyzed' would do. for example, if i have a music json object and want to organize the facet results based on genre, i want to see each genre as the whole genre term (rhythm and blues) and not one facet for 'rhythm' and one for 'blues', and i want to be able to search on 'rhythm and blues' and have it match 'Rhythm and Blues'

How to use POCOs with Fields in Elasticsearch.Net (NEST)?

ε祈祈猫儿з 提交于 2019-12-19 04:38:12
问题 How to I get a strongly-typed list of objects back when doing a search that uses Fields() ? For example: var searchResult = client.Search<Person>(s => s .Fields("title", "name") .Query(q => q.Match(...etc...) .Highlight(...etc...) ); It seems like the generic type parameter is useless when .Fields() is used because the Hits that are returned have a null .Source property. (I'm hoping there's a way to do it without having to manually map the search results back to my original Person POCO.) 回答1:

Elasticsearch using NEST: How to configure analyzers to find partial words?

左心房为你撑大大i 提交于 2019-12-19 03:53:12
问题 I am trying to make a search by partial word, ignoring casing and ignoring the accentuation of some letters. Is it possible? I think ngram with default tokenizer should do the trick but i don't understand how to do it with NEST. Example: "musiic" should match records that have "music" The version I am using of Elasticsearch is 1.9. I am doing like this but it doesn't work... var ix = new IndexSettings(); ix.Add("analysis", @"{ 'index_analyzer' : { 'my_index_analyzer' : { 'type' : 'custom',

Returning Raw Json in ElasticSearch NEST query

不羁岁月 提交于 2019-12-19 02:26:34
问题 I'm doing a small research about a client for elastic search in .net and I found that NEST is one of the most supported solutions for this matter. I was looking at Nest's docummentation and I couldn´t find a way to output a raw json from a query and avoid the serialization into an object, because I'm using angularJs in the front end I don´t want to overload the process of sending the information to the client with some unnecessary steps. ......and also I'd like to know how can I overrdide the