nest

Elasticsearch Nest wildcard query with spaces

ⅰ亾dé卋堺 提交于 2019-12-12 11:19:38
问题 Short version: I would like to write an elastic search query using Nest to get the full indexed items ( ContentIndexables in my case as my custom type) which have been indexed. The query is subject to a term query of [some string] + * (i.e. String.StartsWith() where [some string] may or may not contain spaces. This is different to CompletionSuggester since I need to retrieve the full object and not string suggestions. What I've tried so far: When I query for a text without spaces, the desired

ElasticSearch Order By String Length

自闭症网瘾萝莉.ら 提交于 2019-12-12 10:33:23
问题 I am using ElasticSearch via NEST c#. I have large list of information about people { firstName: 'Frank', lastName: 'Jones', City: 'New York' } I'd like to be able to filter and sort this list of items by lastName as well as order by the length so people who only have 5 characters in their name will be at the beginning of the result set then people with 10 characters. So with some pseudo code I'd like to do something like list.wildcard("j*").sort(m => lastName.length) I'm new to ElasticSearch

ElasticSearch - NEST - how to combine AND and OR statements

筅森魡賤 提交于 2019-12-12 09:04:16
问题 I am new to ElasticSearch - NEST API. We are trying to prepare multiple conditions with AND/OR clauses. For example - (Condition 1 OR Condition 2) AND (Condition 3) Currently we are trying by concatenating the query conditions. Can anyone provide the better example using NEST API? 回答1: Well there is something called Bool Query in ElasticSearch. A query that matches documents matching boolean combinations (AND, OR, NOT) of other queries. It is built using one or more boolean clauses, each

Filling the gaps in D3 array nesting

馋奶兔 提交于 2019-12-12 08:27:11
问题 I have an array or objects consisting of a date and some values: var flatData = [ { "date": "2012-05-26", "product": "apple" }, { "date": "2012-07-03", "product": "orange" }, ... ] I am trying to use d3.nest() to get a count of these objects by year and then by month. var nestedData = d3.nest() .key(function(d) { return d.date.split('-')[0]; }) // key is the year .sortKeys(d3.ascending) .key(function(d) { var splitDate = d.date.split('-'); return splitDate[0] + '-' + splitDate[1]; // key is

Elasticsearch.Net - Changes after upgrading from v1.9 to v5.4

你。 提交于 2019-12-12 05:41:27
问题 I have noticed a lot of changes in ES after upgrading it from v1.9 to v5.4. I am still having doubts about the querying techniques in ES. In v1.9 I have noticed that the Filter option differs. I am wondering how I can replicate the below code in v5.4 searchDescriptor.Query(q => q.Filtered(m => m.Query(n => matchQuery).Filter(o => o.And(filterContainer.ToArray())))) Here I see Filter(o => o.And(filterContainer.ToArray()) how is it possible to do an And or an Or operation with v5.4? Does Filter

In elastic search is a collection queryable while its being added to the index

落爺英雄遲暮 提交于 2019-12-12 05:39:56
问题 I'm using Nest to insert a list of 60k+ objects into elastic search, specifically calling client.IndexMany(list, indexName). As the list is inserted, is it query-able? or is it only query-able after the complete list is indexed? If its the former, is there a way to force it to only be query-able after the list is fully indexed? 回答1: Ad1. The answer is no. Document isn't immediately available for search after indexing. Definitive guide has really nice chapter why elasticsearch works this way.

Custom “tab” Tokenizer in ElasticSearch NEST 2.4

淺唱寂寞╮ 提交于 2019-12-12 05:22:56
问题 I have an index with many fields, and one field "ServiceCategories" has data similar to this: |Case Management|Developmental Disabilities I need to break up the data by the separator "|" and I have attempted to do so with this: var descriptor = new CreateIndexDescriptor(_DataSource.ToLower()) .Mappings(ms => ms .Map<ProviderContent>(m => m .AutoMap() .Properties(p => p .String(s => s .Name(n => n.OrganizationName) .Fields(f => f .String(ss => ss.Name("raw").NotAnalyzed()))) .String(s => s

Nest renders range boundaries as string instead of double

℡╲_俬逩灬. 提交于 2019-12-12 05:09:37
问题 I am querying ElasticSearch with Nest, with this code: var mustTerms = new List<Func<QueryDescriptor<ElasticCheckIn>, Nest.QueryContainer>>(); var dmaxPrice = maxPrice.HasValue ? (double?)maxPrice.Value : 100000d; var dminPrice = minPrice.HasValue ? (double?)minPrice.Value : 0d; mustTerms.Add(mt => mt.Range(rd => rd.OnField("price").LowerOrEquals(dmaxPrice).GreaterOrEquals(dminPrice))); Func<QueryDescriptor<ElasticCheckIn>, Nest.QueryContainer> queryFunc = qd => qd .FunctionScore(fsq => fsq

FileSystemwatcher with Documents Indexing as Attachments

拜拜、爱过 提交于 2019-12-12 05:07:50
问题 I'm trying to reproduce a console application which watches a folder and any new additions of documents to the folder are to be Indexed to ES . It is working fine If I move/add 3-4 documents at a time and able to index. But if I move around 30 documents at a time, It is not indexing all the documents, instead indexing only one. But If I run the code with break points , then even 30 documents are also getting indexed. Can some one help me in solving this. static void OnCreated(object sender,

Display elastic search hits values using NEST

亡梦爱人 提交于 2019-12-12 04:53:59
问题 I am using following code for searching the articleid and control fields. it will hold the 2 fields values. But I can't access these two fields values. HERE search<> is dynamic. var searchrange = _client.Search<dynamic>(s => s .Indices("kb_v2").Types("kb") .From(0).Size(10) .Fields("articleid","control") .Query(q => q .Range(r =>r .OnField("articleid") .Greater("2") .Lower("5")))); can you explain How to get the this two fields values.. 回答1: Since Elasticsearch 1.0 fields are always returned