FAQ Database Discussion Community


Bulk insert to ElasticSearch with NEST

c#,elasticsearch,nest,elasticsearch-net
I try to add 100k products to elasticsearch, but when i try i get: {"Validation Failed: 1: no requests added;"} My code: var Node = new Uri("......"); var ConnectionPool = new SniffingConnectionPool(new[] { Node }); var Config = new ConnectionConfiguration(ConnectionPool) .SniffOnConnectionFault(false) .SniffOnStartup(false) .SniffLifeSpan(TimeSpan.FromMinutes(10)); var Client = new ElasticsearchClient(Config); var AllProducts...

ElasticSearch REST - insert JSON string without using class

elasticsearch,elastic,elasticsearch-net
I am looking for an example where we can push below sample JSON string to ElasticSearch without using classes in REST api. { "UserID":1, "Username": "Test", "EmailID": "[email protected]" } We get the input as xml and we convert it to JSON string using NewtonSoft.JSON dll. I know REST api is...

Possible to do multifield range query?

elasticsearch,nest,elasticsearch-net
I would like to execute a range query against multiple fields, or a field with a suffix, like markups.*. There doesn't seem to be a way to do this in Nest or Elasticsearch. For example this query in ES returns results: { "query": { "range": { "markups.1": { "gte": "2015-01-01T00:00:00.000",...

Elasticsearch query using NEST & QueryRaw

elasticsearch,nest,elasticsearch-net
I have the following Elastic Search query: { "query": { "filtered": { "query": { "multi_match": { "query": "main", "type": "cross_fields", "fields": [ "field1^5", "test", "field2", "abc" ], "operator": "and" } } } }, "sort": [], "from": 0, "size": 20 } I am trying to run this query using NEST client...

Elasticsearch.NET NEST Object Initializer syntax for a highlight request

c#,nest,object-initializers,elasticsearch-net
I've got: var result = _client.Search<ElasticFilm>(new SearchRequest("blaindex", "blatype") { From = 0, Size = 100, Query = titleQuery || pdfQuery, Source = new SourceFilter { Include = new [] { Property.Path<ElasticFilm>(p => p.Url), Property.Path<ElasticFilm>(p => p.Title), Property.Path<ElasticFilm>(p => p.Language), Property.Path<ElasticFilm>(p => p.Details), Property.Path<ElasticFilm>(p => p.Id) } }, Timeout = "20000"...

Nest elastic search.net not returning any results via any query

asp.net,asp.net-mvc,nest,elasticsearch-net
I've created an index in sense which I'm happy with and am trying to implement a typed query in the NEST client as follows: var node = new Uri("http://elasticsearch-blablablamrfreeman"); var settings = new ConnectionSettings(node) .SetTimeout(300000) .SetDefaultIndex("films") .MapDefaultTypeIndices(d => d .Add(typeof(film), "films")) .SetDefaultPropertyNameInferrer(p=>p); Inject it (amongst the searcher and indexer) with...