287 questions
1
vote
2
answers
300
views
Specify Elasticsearch Ingest Pipeline in Spring Data Elasticsearch
I am using the Elasticsearch's 8.x Java API client for indexing documents to Elasticsearch. While indexing, I'm specifying an ingest pipeline to be executed during data ingestion.
public Mono<...
0
votes
1
answer
53
views
Elasticsearch How to exclude indices when using Java Api Client
Elk-Stack Version: 8.7.1
Java Api Client: 8.13.1
When executing a search I want to search over all indices excluding all indices that start with a dot.
According to the regular Elasticsearch Api you ...
0
votes
1
answer
385
views
Writing a script score search using elastic search Java API
I have the following query to use with Elasticsearch.
{
"query": {
"function_score": {
"query": {
"match_all": {}
},
"...
0
votes
0
answers
155
views
Migrating from ElasticSearch 1.7 to 7.17 using Java Client API - filteredQuery
I'm migrating from ES1.7 to 7.17. Facing some issues with implementing filteredQuery using Java Client API.
For example, in 1.7.5
QueryBuilder queryBuilder = QueryBuilders.filteredQuery(QueryBuilders....
0
votes
2
answers
670
views
Using terms in NativeQuery to search for multiple optional matches
The elasticsearch document has "flattened" fields that can contain one or more pairs of "name":"value".
For example, the "flattened" fields "genre" ...
0
votes
1
answer
268
views
Saving an elasticsearch query for reuse possible?
Does anyone know if this is possible? The closest thing I've seen is the save query option in Kibana. But I'd like to have this for Java/Spring. My idea is for users to build their own elasticsearch ...
0
votes
1
answer
508
views
Elastic-search java - Nested field count and sum sub aggregation
I have following structure in elastic search index
{
"_index" : "hotel",
"_type" : "_doc",
"_id" : "13171",
"...
0
votes
1
answer
561
views
Quarkus Native on GraalVM issue with ElasticSearch Java Client jakarta.json.JsonException: Provider org.eclipse.parsson.JsonProviderImpl not found
I'm using Quarkus 2.16.6.Final with ElasticSearch 8.7. I've written a small piece of code to use ES's update_by_query feature.
try (Reader query = new StringReader(/*my json query String*/)) {
var ...
1
vote
1
answer
1k
views
mapping elasticsearch inner hits result to class within java
I don't even know how to word this question properly so here's my best.
This is the result of me getting the innerhits from a nested field called "attributes" I have for an index (after ...
1
vote
0
answers
2k
views
Deserialize an elastic search hit to Hit<ObjectNode>
I'm trying to create a Hit<ObjectNode> from a json string returned by Elastic (for unit-testing purposes). When I try to deserialize this using .withJson I get a ClassCastException with the ...
0
votes
1
answer
441
views
Replacement for SearchTemplateRequest class in java api client
I am migrating a java application from elastic search high level client to java api client. There is a SearchTemplateRequest class in elastic search java high level client. But I couldn't find any ...
1
vote
1
answer
2k
views
How do I use point in time with search after in ElasticSearch JAVA API?
I'm trying to test pagination in the latest release (8.5) with point-in-time and search after in the Java API. I don't know exactly how to implement it as the Java API documentation is barely existent ...
0
votes
1
answer
2k
views
Which Java ES client should I use with ElasticSearch 7.6 cluster?
I want to use Java API client provided by ElasticSearch but I don't know if it would be compatible with my cluster.
I saw there was ElasticSearch High Level REST client which has been deprecated for ...
1
vote
1
answer
960
views
Connect to Elastic Cloud from the Java Client
I've been trying to connect to my ES instance on the Elastic cloud with no success using the Java client and following the Documentation
In the hostname I put https://myinstance-xx.europe-west1.gcp....
1
vote
1
answer
2k
views
Set timeout in Elastic Java API Client
I am trying to move from Elastic High level rest client to Elastic Java API Client (Low Level Rest Client). I am able to get the response, but i want to set the timeout for my elastic query.
But this ...
0
votes
1
answer
618
views
Multimatch query failure
Hi Team I am using elasticsearch after a long time and facing some difficulties with multi_match queries.
Essentially my query need to have an exact match on 2 fields and should do a text search on 4 ...
0
votes
1
answer
520
views
ListenerExecutionFailedException Nullpointer when trying to index kafka payload through new ElasticSearch Java API Client
I'm migrating from the HLRC to the new client, things were smooth but for some reason I cannot index a specific class/document. Here is my client implementation and index request:
@Configuration
...
1
vote
1
answer
3k
views
New elasticsearch-java API `CreateIndexRequest` using `.withJson` causes `co.elastic.clients.util.MissingRequiredPropertyException`
I am having a hard time on using the new elasticsearch-java api client.
I am migrating from HLRC to the new elasticsearch java api.
When I create an index, I used CreateIndexRequest and load it with ...
3
votes
3
answers
10k
views
Creating a TermQuery with a List by using Elasticsearch Java API Client
I am trying to convert some Java High Level REST Client code to new Elasticsearch Java API Client.
I want to convert this query which retrieves the contents if the id is equal to 10 or 20.
...
2
votes
1
answer
6k
views
returning the entire Elasticsearch response (as SearchResponse) from Java API Client in Spring Boot REST API
I'm learning about Elasticsearch and the Java Client API (currently just following the documentation), it works well but I'm wondering if it's possible to return the whole search response from a query ...
1
vote
0
answers
567
views
Simple aggregation is getting failed in javaelasticsearch 8.0+ client
I have got a simple method that performs simple terms aggregation using elastic search8.0
I am able to do it using RestHighLevelClient but with ElasticsearchClient I am getting empty buckets.
can ...
1
vote
1
answer
404
views
Elastic 8.1.1 - Cannot instantiate FunctionScore, build() protected
I am trying to migrate some elastic functionalty from elasticsearch 6.5.4 -> 8.1.1, specifically a functionScoreQuery:
private SearchRequest buildRequest(String query) {
SearchRequest ...
1
vote
1
answer
2k
views
highlight of elasticsearch in java?
i need to highlight the match word in a document,
in java client.
i don't know where to fix highlight object
this is my java code for search:
HighlightBuilder highlightBuilder = new ...
0
votes
1
answer
2k
views
Ranged query with Java Client API for Elasticseach 8.0+
I found some topics about ranged queries and Elasticsearch but these use the deprecated High Level REST Client interface. I also found a discussion on the elasticseach page which uses the new ...
3
votes
6
answers
6k
views
How to get the json representation of the ElasticSearch query/request that was built with Java API Client (7.16)?
A new Java API Client was released in the 7.16 version of ES and the Java Rest Client was deprecated. There was the ability to convert a query to JSON in the deprecated client. It was convenient for ...