nest

Adding Timestamp to each document added in ElasticSearch

☆樱花仙子☆ 提交于 2019-12-11 22:27:42
问题 How can I create an Index and Mapping with the timestamp field so each added document will include a timestamp by default. I am using NEST (C#) but I just cant figure out how to do it. I am also using Kibana but it seems not to work properly because I am missing the timestamp field. Also, after I am adding this field, is there any way I can 'confirm' the field is added? can I query this field? Thanks! 回答1: When you index a document a _timestamp field can be automatically generated for each

Difference between @timestamp and timestamp field in elasticsearch

微笑、不失礼 提交于 2019-12-11 20:02:57
问题 When I logged some requests to elastic search using log stash, it puts @timestamp field as time. And when I logged those requests using NEST and set timestamp field, it puts timestamp field. When I see data using kibana, those 2 fields have separate name. What is difference between them? 回答1: The @timestamp field is kind of an internal field for log stash. That is why the @ sign is in front of the field. Could be any other field that stores a timestamp. Just like elasticsaerch uses the _ for

Issue with create index with mapping

一个人想着一个人 提交于 2019-12-11 19:44:51
问题 I'm using elastic search version 7.1.0 and NEST 6.7.0 with Elasticsearch.Net 6.7.0. While I'm trying to create an index I've got an error. This is my code, I was using the same code on NEST and Elasticsearch.Net version 6.4.0 and it was working fine var result = Client.CreateIndex(DefaultIndex, c => c .Settings(s => s .NumberOfShards(numberOfShards) .NumberOfReplicas(numberOfReplicas) .BlocksReadOnly(false) ) .Mappings(m => m .Map<SearchDocument>(mm => mm .AutoMap(3) ) ) ); This is the error

ArticleCase missing from nest elision filter?

橙三吉。 提交于 2019-12-11 17:57:31
问题 According to this page, the french analyzer is defined with a case-insensitive elision step like so: ... "french_elision": { "type": "elision", "articles_case": true, // <==== Note this article case property "articles": [ "l", "m", "t", "qu", "n", "s", "j", "d", "c", "jusqu", "quoiqu", "lorsqu", "puisqu" ] }, ... In trying to recreate this in NEST (v6.6), I seem to have hit a snag in that the ArticleCase call doesn't seem to exist. Is is just missing as a bug? Or is there another way this is

Elastic search Nest - map update string property as not analysed

自作多情 提交于 2019-12-11 16:01:01
问题 I'm trying to map MyCode property in my object (posted down) as NotAnalyzed using fluent. I've already reviewed: Creating an index Nest and Nest and Elastic Search - Mapping { "myobject_test" : { "mappings" : { "myversion" : { "properties" : { "id" : { "type" : "long" }, "isLatest" : { "type" : "boolean" }, "maxVersion" : { "type" : "long" }, "original" : { "properties" : { "agent" : { "properties" : { "name" : { "type" : "string" }, "organizationId" : { "type" : "long" }, "version" : { "type

Update field mappings template in created index under an alias

爷,独闯天下 提交于 2019-12-11 16:00:14
问题 I have deployed a template in AWS ElasticSearch named users-version-1-order-1 , and indexed data under users-all index which is searchable via users alias. So, all documents are always indexed and updated in users-all , how do I deal with schema change moving forward with applying a new template version? e.g. PUT users-version-2-order-2 and apply it to users-all index. [UPDATE] { "index_patterns": "users*", "order": 6, "version": 6, "aliases": { "users": {} }, "settings": { "number_of_shards"

How to implement suggest completion with NEST 6.1.0?

橙三吉。 提交于 2019-12-11 15:48:40
问题 So far I have this (for indexing): var createIndexResponse = await elasticClient.CreateIndexAsync(indexName, c => c .InitializeUsing(indexConfig) .Mappings(m => m .Map<ElasticsearchModel>(mm => mm .Properties( p => p .Completion(cp => cp .Name(elasticsearchModel => elasticsearchModel.StringTest) .Analyzer("simple") .SearchAnalyzer("simple") ) .Text(t => t.Name(elasticsearchModel => elasticsearchModel.StringTest).Analyzer("customAnalyzerLowercaseSynonymAsciifolding")) ) ) ) ); I got to this

creating an index for percolate query

China☆狼群 提交于 2019-12-11 15:28:48
问题 I'm trying percolate query in elasticsearch, but creating an index as explained in the docs I'm greeted with an error. I ran the following: PUT /my_percolate_index { "mappings": { "doctype": { "properties": { "message": { "type": "text" } } }, "queries": { "properties": { "query": { "type": "percolator" } } } } } I'm greeted with the following error: { "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "Rejecting mapping update to [my_percolate_index] as the final

How long does it take from getting a document upserted into ES before it can be searched against correctly?

独自空忆成欢 提交于 2019-12-11 14:53:44
问题 I'm using ES to retrieve data, which I change and update back in ES followed by doing the same search query - it looks like I don't always get the updated document back down and have to wait a second or two. Using the following code: esClient.Update<TESDocModel, TESDocModel>(new DocumentPath<TESDocModel>(docId), u => u.Index(index).Doc(toUpdate).DocAsUpsert(true)); Is this correct behaviour or should a document be immediately searchable after the upsertdocument operation is complete? 回答1:

Facing some problem while trying to create lambda expression in C# with NEST in elastic search, using Nest 6.0

帅比萌擦擦* 提交于 2019-12-11 14:27:40
问题 As of now i have Elastic query with json format, now i am trying to convert this query with Nest extension for Asp.Net c# in lambda expression. Facing this problem, any body can help to create the Lambda expression with help of json query. I have tried, but it's list type inside the query, so while i am trying giving error might be my lambda expression is not correct. { "query": { "bool": { "must": [ { "bool": { "should": [ { "bool": { "must": [ { "term": { "variant": "vxi" } }, { "term": {