Questions tagged [elasticsearch-net]

Repository for both Elasticsearch.Net and NEST, the two official elasticsearch .NET clients.

  • low-level client that provides a one-to-one mapping with the Elasticsearch REST API.
  • No dependencies
  • Almost completely generated from the official REST API spec which makes it easy to keep up to date
  • Comes with an integration test suite that can be generated from the YAML test definitions that the Elasticsearch core team uses to test their REST API
  • Has no opinions on how you create or consume requests and responses
  • Load balancing and cluster failover support *All calls have async variants

Home page for both Elasticsearch.Net and NEST, the two official elasticsearch .NET clients, can be found here.

Source code repository is here.

261 questions
1
vote
1 answer

Multiple values in QueryString query using elasticsearch NEST

I need to get the documents from ES using NEST client with multiple like conditions on a single field. My query is as: SELECT * FROM Customer WHERE CustomerName LIKE '%john%' OR CustomerName Like '%george%' My elastic search NEST query (for single…
Syed Fasih
  • 302
  • 4
  • 12
1
vote
1 answer

ElasticSearch: Query for data immediately after write

I have a requirement to be able to read the data immediately by key after writing into ES. Is this possible? Note that DataMap is a key value pair and _id is pathed to key field. string v = "Foobar" + i; string k =…
frosty
  • 2,421
  • 6
  • 26
  • 47
1
vote
1 answer

Elasticsearch.Net 1.0.2 + NEST 1.0.2 not working correctly?

I use following query: var searchResults = client.Search(s => s .Index("someIndex") .From(0) .Size(20) .AllTypes() .MatchAll() .Query(q => q .Bool(bq =>…
0
votes
1 answer

Handle response from SQL query in Elastic.Clients.Elasticsearch 8.1.0 for .NET

I have an Elasticsearch cluster, which e.g. contains an index called persons. I want to query the documents of the index using the SQL API of Elasticsearch. When using the REST API of Elasticsearch via Kibana everything works fine: POST…
0
votes
1 answer

Elasticsearch NEST add normalizer on all keyword fields with NoopPropertyVisitor

Im trying to add custom normalizer on all keyword fields. Im using NoonPropertyVisitor to override: public class CustomNormalizerVisitor : NoopPropertyVisitor { public override void Visit(IKeywordProperty type, PropertyInfo propertyInfo,…
0
votes
1 answer

Elasticsearch pattern_syntax_exception Illegal repetition near index

I'm trying to create a pattern analyzer using a .NET Client (NEST ver. 7.17.4 with Elastic 8.4) and I'm getting the following exception. Elasticsearch.Net.ElasticsearchClientException: 'Request failed to execute. Call: Status code 400 from: PUT…
cah1r
  • 1,751
  • 6
  • 28
  • 47
0
votes
0 answers

How implement filter by date range for some field using NEST for .net?

I attempt calculate count of documents in index by date range for some field. For this I have simple method like bellow. public async Task GetCount(OemCatalogRequest request) { string sd =…
user6408649
  • 1,227
  • 3
  • 16
  • 40
0
votes
0 answers

How to declare a delegate with arguments?

I want to reuse the following code: readonly Func, QueryContainer> query = q => q.DateRange(d => d.GreaterThanOrEquals(startDate).LessThanOrEquals(endDate)); For example, one of methods: public async Task…
user6408649
  • 1,227
  • 3
  • 16
  • 40
0
votes
0 answers

How dynamically add query using ElasticSearch .NET client?

The following query calculates the count of documents in index: public async Task GetCount(DateTimeOffset? startDate, DateTimeOffset? endDate, string eventName) { var count = await _elasticClient.CountAsync(c =>…
user6408649
  • 1,227
  • 3
  • 16
  • 40
0
votes
1 answer

ElasticSearch NEST create index mapping dynamically

we have a system in which a client can add new fields to his index mapping in an xml file. When that happens we would take the xml file and based on it create index in the search engine. This is a legacy requirement which we need to support. So if…
cah1r
  • 1,751
  • 6
  • 28
  • 47
0
votes
1 answer

ELASTICSEARCH NEST Automap string override either that string fields receive a keyword normalizer or something else, for case insensitive search

Im very unfamiliar with ElasticSearch, but basically I've been trying to figure out how to make all database fields that are string to be searchable case insensitively. As currently the Automap creates them with text fields and keyword textfields…
0
votes
1 answer

How to divide the returned documents into a fix number of buckets in Elasticsearch

I have a question that I thought was simple to google but I couldn't find an answer. I have an index of articles with an optional field price among the many. I'd like to create an aggregation that divides all the articles matching the query in…
Kralizek
  • 1,999
  • 1
  • 28
  • 47
0
votes
1 answer

Elasticsearch NEST MultiGet across multiple indexes

I want to run a MultiGet (mget) search query on several IDs across two indexes. This is because I have two indexes, but I don't know which index contains my ID. This is the query: GET _mget { "docs" : [ { "_id": "id1", …
user17365408
0
votes
0 answers

Elastic Search Complex Logical Query (SQL to ElasticSearch Query)

My document schema is as follows. Post Id Title Body Privacy -> Values can only be ["Me", "Anyone", "Team"] UserId What I want to do is retrieve all documents, but exclude documents where Privacy = "Me" and UserId != "My-User-Id" The SQL…
Coder Guy
  • 185
  • 5
  • 12
0
votes
1 answer

Elasticsearch NEST fluent DSL Field name .Suffix causes syntax error

Using NEST DSL to filter on the "keyword" suffix of the FileLogNum field. public class ElasticSearchAttachment { public string FileLogNum { get; set; } } which elasticsearch returns as {"mappings":…
john nowlin
  • 135
  • 10