262 questions
0
votes
0
answers
16
views
How to validate a raw Elasticsearch DSL query string with Elastic.Clients.Elasticsearch v8?
I am using the Elastic.Clients.Elasticsearch v8.19.11 client to connect to Elasticsearch. I want to validate a DSL query provided as a raw JSON string.
I'm not looking for simple JSON validation. ...
1
vote
1
answer
312
views
Implementing Highlighter when migrating from elasticsearch.net 7.17 to elastic.clients.elasticsearch 8.x
I am attempting to migrate from elasticsearch.net client 7.17 to elastic.clients.elasticsearch 8.x and am having trouble implementing the new syntax for the highlighter. I think the pre and post tags ...
1
vote
2
answers
3k
views
NEST is adding TimeZone while indexing docs in Elasticsearch
I have a DateTime field in my c# class as below
public DateTime PassedCreatedDate { get; set; }
While indexing it from NEST to elasticssearch, it is saving it along with local timezone. How to avoid ...
0
votes
0
answers
186
views
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....
0
votes
1
answer
448
views
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 ...
0
votes
1
answer
471
views
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(...
0
votes
0
answers
90
views
How to declare a delegate with arguments?
I want to reuse the following code:
readonly Func<QueryContainerDescriptor<OemCatalogModel>, QueryContainer> query = q => q.DateRange(d => d.GreaterThanOrEquals(startDate)....
30
votes
4
answers
92k
views
Like search in Elasticsearch
I am using elasticsearch for filtering and searching from json file and I am newbie in this technology. So I am little bit confused how to write like query in elasticsearch.
select * from table_name ...
1
vote
2
answers
624
views
C# Elastic aggregate query with size and date range limit
I have the following query which groups by a primary key mainjobid and then groups by a supplied time interval. I would like to restrict the aggregation and hits to a time range supplied by two ...
0
votes
1
answer
844
views
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 ...
0
votes
1
answer
212
views
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 ...
1
vote
1
answer
1k
views
Nest - Reindexing
Elasticsearch released their new Reindex API in Elasticsearch 2.3.0, does the current version of NEST (2.1.1) make use of this api yet? If not, are there plans to do so?
I am aware that the current ...
1
vote
1
answer
1k
views
How do I use Elasticsearch NEST to return results using match search?
I am trying to write a simple console app using C# and NEST to learn more about Elasticsearch.
I can run the following query in Sense (Kibana)
GET /companies/company/_search
{
"query": {
...
0
votes
2
answers
924
views
I can't get nested stored_fields
All.
I'm using ElasticSearch 5.0 and I have next mapping:
{
"mappings": {
"object":{
"properties":{
"attributes":{
"type":"nested",
...
2
votes
1
answer
848
views
Why is elasticsearch's Nest lowlevel Search method ignoring type and index name defined in SearchDescriptor<>() object
NEST/Elasticsearch.Net version:5.6.5
Elasticsearch version:5.4.3
We are trying to fetch result from our index using the LowLevelClient. We are using the below SearchAsync API
var searchDescriptor = ...
0
votes
0
answers
189
views
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 ...
5
votes
1
answer
16k
views
Simple match query to C# Nest
I new to Elasticsearch I have cURL
GET /index/type/_search
{
"query": {
"match": {
"TextID": "WT"
}
}
}
I want to convert ...
0
votes
1
answer
1k
views
Defining index templates on ElasticSearch with .NET client
I have ElasticSearch running in a Docker cluster, I use it to search through a ASP.NET core API that queries ES.
I would like to define the index mappings for ES at cluster creation, running a job in ...
0
votes
0
answers
740
views
Nest fails to write to ES while executed from Azure functions
I do have azure function which listens to events and write data to ES, but randomly it fails.
Exception while executing function: ElasticSearchIndexer Invalid NEST response built from a unsuccessful ...
0
votes
1
answer
962
views
Search with Russian text analyzer does not work
I have very simple model for ElasticSearch:
[ElasticsearchType(RelationName = "example")]
public class ElasticModel
{
[Text(Name = "description", Analyzer = "Russian",...
0
votes
1
answer
144
views
NEST 7: How to get occurrence number for each document?
I'm using NEST 7.0 and C# to run search queries for Elasticsearch storage using Fluent DSL style. I use MultiMatch to search by passed string value in several number of fields:
queryContainer &= ...
5
votes
1
answer
4k
views
Elasticsearch.NET NEST Object Initializer syntax for a highlight request
I've got:
var result = _client.Search<ElasticFilm>(new SearchRequest("blaindex", "blatype")
{
From = 0,
Size = 100,
Query = titleQuery || ...
0
votes
1
answer
398
views
Group, calculation and order of ElasticSearch data
I have a lot of data stored in the following format (I simplified the data to explain the problem).
What I need is:
group all the data by "Action Id" field
calculate the difference between max and min ...
0
votes
1
answer
680
views
Update multiple documents with same property in NEST Client- Elastic Search
I have an update query which modifies only a single document. But I need to pass multiple documents as input and update them.
Previous code is as follows.
var clientProvider = new ...
3
votes
1
answer
2k
views
SearchDescriptor.Type method is missing in Nest 7.x
Currently, We are using Nest library version 5.x. As we heart that Nest 7.x is faster, we planned to upgrade version from 5.x to 7.x. While upgrading the library version, I have found that some ...