nest

indexing and full text searching in elasticsearch without dialitics using c# client Nest

时光总嘲笑我的痴心妄想 提交于 2019-12-01 12:33:41
I'm preparing an in-site search engine with elasticsearch and I'm new to elasticsearch. Sites which will use this engine are Turkish / English . In Turkey, we have Turkish letters like 'ğ', 'ü', 'ş', 'ı', 'ö', 'ç' . But when we search generally we use the letters 'g', 'u', 's', 'i', 'o', 'c' . This is not a rule but we generally do it, think like a habit, something we used to. Now, I have a document type called "product" and this type has several string properties and some are nested. For example: public class Product { public string ProductName { get; set; } public Category Category { get;

ElasticSearch NEST 5.6.1 Query for unit test

时光怂恿深爱的人放手 提交于 2019-12-01 12:23:48
问题 I wrote a bunch of queries to elastic search and I wanted to write a unit test for them. using this post moq an elastic connection I was able to preform a general mocking. But When I tried to view the Json which is being generated from my query I didn't manage to get it in any way. I tried to follow this post elsatic query moq, but it is relevant only to older versions of Nest because the method ConnectionStatus and RequestInformation is no longer available for an ISearchResponse object. My

ElasticSearch Nest. better code for terms aggregation and its iteration

你。 提交于 2019-12-01 12:21:54
问题 I'd like to fetch a list of unique numeric user IDs in given period. Let say the field is userId and time field is startTime , I successfully get results as below; HashSet<int> hashUserIdList= new HashSet<int>(); // guarantees to store unique userIds. // Step 1. get unique number of userIds var total = client.Search<Log>(s => s .Query(q => q .DateRange(c => c.Field(p => p.startTime) .GreaterThan(FixedDate))) .Aggregations(a => a .Cardinality("userId_cardinality", c => c .Field("userId"))))

ElasticSearch 5.x Context Suggester NEST .Net

不问归期 提交于 2019-12-01 10:52:28
I'm trying to create an Index with a context suggester with Nest 5.0 on ElasticSearch 5.1.2. Currently, I can create the mapping: elasticClient.MapAsync<EO_CategoryAutocomplete>(m => m .Properties(p => p .Completion(c => c .Contexts(ctx => ctx .Category(csug => csug .Name("lang") .Path("l") ) .Category(csug => csug .Name("type") .Path("t") ) .Category(csug => csug .Name("home") .Path("h") ) ) .Name(n => n.Suggest) ) ) ); But in the POCO class i dont know what object type must be Suggest Property marked with ????? : public class EO_CategoryAutocomplete { public string Id { get; set; } public ??

ElasticSearch 5.x Context Suggester NEST .Net

吃可爱长大的小学妹 提交于 2019-12-01 07:44:22
问题 I'm trying to create an Index with a context suggester with Nest 5.0 on ElasticSearch 5.1.2. Currently, I can create the mapping: elasticClient.MapAsync<EO_CategoryAutocomplete>(m => m .Properties(p => p .Completion(c => c .Contexts(ctx => ctx .Category(csug => csug .Name("lang") .Path("l") ) .Category(csug => csug .Name("type") .Path("t") ) .Category(csug => csug .Name("home") .Path("h") ) ) .Name(n => n.Suggest) ) ) ); But in the POCO class i dont know what object type must be Suggest

How do && and || work constructing queries in NEST?

落花浮王杯 提交于 2019-12-01 06:58:09
问题 According to http://nest.azurewebsites.net/concepts/writing-queries.html, the && and || operators can be used to combine two queries using the NEST library to communicate with Elastic Search. I have the following query set up: var ssnQuery = Query<NameOnRecordDTO>.Match( q => q.OnField(f => f.SocialSecurityNumber).QueryString(nameOnRecord.SocialSecurityNumber).Fuzziness(0) ); which is then combined with a Bool query as shown below: var result = client.Search<NameOnRecordDTO>( body => body

Elasticsearch upgrade 2.3.1 Nest client Raw String

可紊 提交于 2019-12-01 06:27:53
While upgrading to elastic 2.3.1 I am running into a snag with the .Net Nest Client. In Nest 1.0, I could read an index's settings from a file and configure the index on creation using the raw string. Is there a way to the something similar in Nest 2.0 or do I have to use the fluent API for each setting including the analysis portion? The same question for mappings. Nest 1.0 private bool CreateIndex(string index, FileInfo settingsFile) { var settings = File.ReadAllText(settingsFile.FullName); IElasticsearchConnector _elastic var response = _elastic.Client.Raw.IndicesCreate(index, settings); if

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

 ̄綄美尐妖づ 提交于 2019-12-01 06:23:50
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' (notice case). it seems the elasticsearch documentation suggests using a custom analyzer of a tokenizer and

Elasticsearch upgrade 2.3.1 Nest client Raw String

青春壹個敷衍的年華 提交于 2019-12-01 04:19:08
问题 While upgrading to elastic 2.3.1 I am running into a snag with the .Net Nest Client. In Nest 1.0, I could read an index's settings from a file and configure the index on creation using the raw string. Is there a way to the something similar in Nest 2.0 or do I have to use the fluent API for each setting including the analysis portion? The same question for mappings. Nest 1.0 private bool CreateIndex(string index, FileInfo settingsFile) { var settings = File.ReadAllText(settingsFile.FullName);

ElasticSearch and NEST: How do you purge all documents from an index?

心不动则不痛 提交于 2019-12-01 02:47:52
I know how to delete an entire ElasticSearch index , but how do you purge all documents from an index? My Motivation: I'd like to have a "ReIndex" method that purges the entire contents of an index so that I can reload all documents. ElasticSearch syntax would be helful. NEST syntax would be even better. hross I was looking for something similar in Nest and I thought I'd put the syntax here for anyone looking: var node = new Uri("http://localhost:9200"); var settings = new ConnectionSettings(node); var client = new ElasticClient(settings); client.DeleteByQuery<ElasticsearchProject>(del => del