nest

Delete a document from ElasticSearch index by id

半腔热情 提交于 2019-12-05 16:52:11
I have a document in elastic search. I am trying to implement a method where I can specify a string id to delete a document from the index using NEST client. This is the indexed doc that I want to delete: "hits":[{"_index":"movies","_type":"list","_id":"100","_score":0.6349302, "_source" : { "owner": "Bob", "tags": "Bobita", "title": "Movie clips of Bob" }} This is my C# code which doesn't delete the doc. It says id is NULL. Uri localhost = new Uri("http://localhost:9200"); var setting = new ConnectionSettings(localhost); setting.SetDefaultIndex("movies"); var client = new ElasticClient

How to search array property by array in elasticsearch with nest client

社会主义新天地 提交于 2019-12-05 13:38:01
Lets say we have a class called acls and this class has a List property called lprop. Now lets say I have another List which has values 1,3,5 and lets say this variables name is tosearch. I want to search tosearch values in acls typed records lprop property in an index of elasticsearch by using nest and finding only one match is sufficient. Ex: `public class acls { public List<int> lprop {get;set;} } public void main() { //.. creating connection and etc.. // we have 3 recs of acls // 1. lprop values: 2,4,6,8 // 2. lprop values: 1,9,0,4 // 3. lprop values: 6,7,8 List<int> tosearch = new int[] {

ElasticSearch and Nest: Why amd I missing the id field on a query?

左心房为你撑大大i 提交于 2019-12-05 13:31:16
I created a simple object that represents a Meeting that has elements such as time, location, name, topic, etc and indexed it in ElasticSearch via Nest. It has an Id field that I leave blank so that ES can generate them. Later on I retrieved all the documents that are missing GEO coordinates so that I may update them. All my returned elements still have null for the id field and when I update them back to ES it creates new documents for them. What am I missing here that makes all my id's null? Thank you Here is the Meeting class (the id prop is redundant but I tried it anyway) [ElasticType

NEST Elasticsearch Reindex examples

↘锁芯ラ 提交于 2019-12-05 05:17:51
my objective is to reindex an index with 10 million shards for the purposes of changing field mappings to facilitate significant terms analysis. My problem is that I am having trouble using the NEST library to perform a re-index, and the documentation is (very) limited. If possible I need an example of the following in use: http://nest.azurewebsites.net/nest/search/scroll.html http://nest.azurewebsites.net/nest/core/bulk.html NEST provides a nice Reindex method you can use, although the documentation is lacking. I've used it in a very rough-and-ready fashion with this ad-hoc WinForms code.

elasticsearch bulk indexing gets slower over time with constant number of indexes and documents

时光毁灭记忆、已成空白 提交于 2019-12-05 00:51:55
问题 I am experiencing that bulk indexing performance using the .NET NEST client and ElasticSearch degrades over time with a constant amount of indexes and number of documents. We are running ElasticSearch Version: 0.19.11, JVM: 23.5-b02 on a m1.large Amazon instance with Ubuntu Server 12.04.1 LTS 64 bit and Sun Java 7. There is nothing else running on this instance except what comes along with the Ubuntu install. Amazon M1 Large Instance : from http://aws.amazon.com/ec2/instance-types/ 7.5 GiB

Matching a complete complex nested collection item instead of separate members with Elastic Search

浪尽此生 提交于 2019-12-04 18:38:55
I have an index with a nested collection of items I want to hit. A collection item contains multiple properties that all have to match a certain query, not just any of them. Here's the model: public class IndexEntry1 { public IEnumerable<NestedType1> NestedProperty1 { get; set; } } public class NestedType1 { public string Member1 { get; set; } public string Member2 { get; set; } } So I want to hit only documents that have a specific combination of Member1 and Member2 values in the IndexEntry1.NestedProperty1 collection. I figured that I had to map the collection as nested. Here's the mapping:

ElasticSearch - NEST - how to combine AND and OR statements

拜拜、爱过 提交于 2019-12-04 16:20:41
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? Utsav Dawn 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 clause with a typed occurrence. The occurrence types are: must: (AND)The clause (query) must appear

Create index with multi field mapping syntax with NEST 2.x

旧巷老猫 提交于 2019-12-04 13:45:48
问题 I just can't seem to get the syntax correct for multi field mapping in NEST 2.0--if that's the correct terminology. Every example I've found for mapping seems to be <= the 1.x version of NEST. I'm new to Elasticsearch and NEST, and I've been reading their documentation, but the NEST documentation hasn't been completely updated for 2.x. Basically, I don't need to index or store the entire type. Some fields I need for indexing only, some fields I'll need to index and retrieve, and some I don't

Nest SuggestCompletion usage, throws 'is not a completion suggest field' exception

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 12:19:29
I'm a complete beginner to elasticsearch and I have been trying to use elasticsearch's completion suggester using Nest for auto-complete on a property. Here is my mapping (as mentioned here : ): var createResult = client.CreateIndex(indexName, index => index .AddMapping<Contact>(tmd => tmd .Properties(props => props .Completion(s => s.Name(p => p.CompanyName.Suffix("completion")) .IndexAnalyzer("standard") .SearchAnalyzer("standard") .MaxInputLength(20) .Payloads() .PreservePositionIncrements() .PreserveSeparators()) ) ) ); var resultPerson = client.IndexMany(documents.OfType<Person>(), new

DeleteByQuery using NEST and ElasticSearch

空扰寡人 提交于 2019-12-04 11:06:53
I'm having a little difficulty getting NEST's DeleteByQuery method to work. Very simply the query never finds anything to delete, and I can't figure out why. I'm using the same query to return records (using Search) and everything works as expected. private void Delete(MyClass someObject) { var response = elasticClient.DeleteByQuery<MyClass>(q => q .Match(m => m.OnField(f => f.Guid).Equals(someObject.Guid)) ); } I've only just started using NEST, so I'm sure this is a pretty simple problem and I'm just being a little dim! Any help/suggestions much appreciated. The .Equals() is a .NET method on