639 questions
0
votes
1
answer
40
views
Elasticsearch query index being updated, not create
I know I can query index creation time with curl 'http://localhost:9200/_cat/indices?v&h=index,creation.date.string'.
Is there a similar query which I can check index update time (not creation ...
3
votes
1
answer
86
views
Calculating document score proportional to matches of array field in Elasticsearch
Let's say I have an Elasticsearch document with the following field mappings:
title -> text
tags -> [text]
Tags is an array of text values to be clear.
I would like to build a query that, ...
0
votes
1
answer
55
views
Elastic Search Analyzer at search time not working
Create the Index with Query-Time Analyzer Only:
PUT /local_persons
{
"settings": {
"analysis": {
"analyzer": {
"person_search_analyzer": {
...
0
votes
1
answer
92
views
Elastic search: Query documents for a field which is greater than another field
I have elastic search documents which look something like this:
{
"id": "1",
"quantityPerUnitOfMeasure": 16,
"availableQuantity": 12,
}
I'd like to ...
0
votes
1
answer
48
views
Term-Based Subsequence Queries in Elasticsearch
I am looking to create an index called 'story' in Elasticsearch. This index will store multiple documents, each containing a field called 'description' which provides some information about the story ...
0
votes
1
answer
56
views
Elasticsearch Query to Retrieve a Fixed Number of Documents from Each Index
I have an Elasticsearch setup with multiple indexes (let's say a, b, c, d, e, and f). My goal is to retrieve a total of 20 documents, with exactly 4 documents from each index. However, if any index ...
0
votes
1
answer
187
views
how to use more Like this query score to function score in Elasticsearch
how to use "more Like this" query score to function score in Elasticsearch
static FunctionScore mltFunctionScore(String text, Double weight, List<String> fields) {
return ...
0
votes
0
answers
49
views
Is there any limit on the value returned from function_score query in ElasticSearch?
This is simplified example query
GET my-index/_search
{
"query": {
"function_score": {
"query": {
"match_all": {}
},
...
0
votes
0
answers
23
views
Fetch common key values from 2 aggregation results
I have aggregation output having two datasets, need to find the key values present in both.
{ "aggregations":{ "data4hr":{
doc_count:12345,
"NAME":{
...
4
votes
1
answer
148
views
ElasticSearch search list of keywords with possible typos
What is the best approach for searching some keywords inside a field that contains a big text in a ElasticSearch index?
I have some words that I want to search inside a field named my_field with ...
0
votes
1
answer
502
views
Elasticsearch date histogram aggregation shows incorrect dates
Im using ES version 6.8, trying to do a query with the Java High Level REST Client. I'm trying to use the Histogram Date Aggregation to get the count of documents by date.
This is my query:
{
"...
1
vote
1
answer
391
views
Elasticsearch - Deleting the previous versions of a document
I have a versioned index in Elasticsearch where I'm storing the document whenever a modification is made to it. After running it for some time I've realised that storing all the versions of a document ...
0
votes
1
answer
224
views
Elastic Search - How to query Array of JSON objects?
I have a data available in ES in the below format. Lets call each json object as campaign object.
{id:"c1", tags:[{key:"k1",value:"v1"}, {key:"k2",value:"...
-2
votes
1
answer
1k
views
Do I need to explicitly clear the index cache after indexing/updating a document?
I have a program that indexes multiple documents into OpenSearch every second. I make these documents available to query on a dashboard with a fixed set of filters. From what I've read online, ...
0
votes
0
answers
89
views
How to prioritize the result based on the specified list of ids in Elastic Search query
To brief:(Elastic Search)
I have set of IDs [12,32,44,32], I need to prioritize the records based on the list of IDs, means I need to bring the record which has the IDs one among the above mentioned ...
0
votes
0
answers
25
views
Search query sorting by phrase not working
This is my current setup the I have for my user_info index
PUT user_info
{
"mappings": {
"properties": {
"username": {
"type": "text&...
0
votes
1
answer
87
views
Elastic search - Seacrh by free text, sort by numeric all of it within a radius
Trying to search within an Index by query string, sort by numeric field all within a specific radius.
There is no reference in the Elastic documentation, so I may have to solve it at the application ...
0
votes
2
answers
296
views
Elasticsearch query in java for regex not working correctly- is the syntax wrong?
Have not had luck finding answers but here is my situation:
QueryBuilders.regexpQuery("regexExpression","\\-?*[0-9]3475[0-9]6");
QueryBuilders.simpleQueryStringQuery("\\-?*...
0
votes
1
answer
106
views
How do I search for a specific value in a nested array in Elastic Search Query?
I'm searching for the following index:
{
"_index": "example-index",
"_type": "_doc",
"_id": "C-123",
"_version": ...
0
votes
1
answer
585
views
Elasticsearch - Sort by matching field, then date
I'm sorting Elasticsearch results in the following order:
Posts with a matching tag;
Posts with a matching title;
Posts with a matching category;
Posts with a matching content;
I've accomplished ...
0
votes
1
answer
54
views
Storing and searching units and value ranges in Elasticsearch
I want to store multiple numerical ranges (array of integer_range) for a document. Each set of ranges is associated to a unit (a text field).
Here's an example:
PUT nested_index/_doc/1
{
"...
0
votes
2
answers
1k
views
Handling of null and [] (empty list)
I am very new to Elasticsearch and I have a question regarding the handling of null and [] (empty list) values. Specifically, in my dummy index example, I have a document as follows
{
"...
0
votes
2
answers
136
views
Using "unique" filter, Elasticsearch analyzes tokens incorrectly
I've been trying to use the **unique ** token filter in my analyzer, but it continue to use duplicate tokens while scoring.
Analyzer:
{
"settings": {
"analysis": {
...
2
votes
1
answer
586
views
Elastic search return the most recent item per term
My index has a created_at date field, and another field account_id. How do I get the most recent document for each account?
I only found the term aggregate which aggregates per term, but it returns ...
1
vote
1
answer
1k
views
In Elasticsearch, how to use a range query on a text field?
There is a 'remark' field in an Elasticsearch index that contains various remarks along with the date when that remark was given.
For example:
remark
------
14/02/2023 To be updated ; 15/02/2023 ...
0
votes
0
answers
158
views
I want to use Elasticserach and kibana alerts to detect line passing
We would like to implement a system that draws a line on a map displayed by kibana in advance and detects when a moving object (such as a boat) passes through the line.
I believe a possible way to do ...
0
votes
1
answer
57
views
searching for space separated words in Elasticsearch
my data is,
POST index_name/_doc/1
{
"created_date" : "2023-02-09T13:21:41.632492",
"created_by" : "hats",
"data" : [
...
0
votes
1
answer
478
views
Elastic search query to find status code by time
I am new to elastic search.
How do I write a query like below
Select count(1)c , status_code
From
Index-b2b-api
Where api-proxy-name = 'some-b2b-api'
Group by status_code
Thanks
0
votes
1
answer
895
views
Return a value if field is missing in Elastic search document
I have an index user. I'm filtering user on LOCATION_ID and _source consists of PHONE_NUMBER & USER_ID, some of the documents do not have PHONE_NUMBER data. It returns a response with just USER_ID....
0
votes
1
answer
165
views
Elasticsearch - terms lookup - filter
I have two indices: users and cars
users contains user_id and car ratings of the user.
ratings objects represent car ratings (by the user)
"user_id": 3,
"ratings": [
{
&...
1
vote
1
answer
143
views
Elasticsearch: Query String vs Simple Query String
What is the exact difference between Query String and Simple Query String? The only difference that is mentioned in the docs is that Query String is more advanced but throws an exception when a sent ...
0
votes
0
answers
173
views
Elasticsearch - Simple Query String not returning result: Multiple Fields with Boost Values
I have a simple_query_string query with multiple fields, each field has different boost values. However, if there is a match of a query in any of the fields with less or no boost value the query ...
1
vote
1
answer
636
views
Elastic Search Json field query with number key
How can I query elastic search based on the number key?
JSON field name
years_of_experience :
"{\"61\": \"10\", \"8240\": \"5\", \"8249\": \"...
1
vote
1
answer
169
views
Elasticsearch - Adding case-insensitive exact match search to custom analyzer
I have an Index as follows:
{
"entities": {
"mappings": {
"properties": {
"content": {
"type": "text",
...
0
votes
1
answer
714
views
How to sort by nested field which has multi-field defined
first of all, this is my very first post on here, so bear with me
I am trying to find a proper way to sort on an elasticsearch nested field in a class which is defined as follows:
public class ...
0
votes
2
answers
613
views
How to sort a query in Elasticsearch based on another field?
In Elasticsearch, I'm storing data as below:
{
"name" : "John Doe",
"country" : "India"
},
{
"name" : "John Doe",
"country"...
0
votes
1
answer
49
views
elasticsearch Geop Shape query not working
One of my document (id = emergency) is a circle having a 30000 meter radius:
GET seller-67/_doc/emergency
{
"_index": "seller-67",
"_type": "_doc&...
0
votes
1
answer
498
views
Query an Array of Objects to be an Exact Match in ElasticSearch
Consider the following index
PUT /orchards
{
"mappings": {
"properties": {
"fruits": {
"type": "nested",
"properties&...
1
vote
1
answer
131
views
Elastic search query string
Why can't I get the same result in the second query as in the third one? What am I doing wrong?
I make this query:
{
"size": 20,
"track_total_hits": false,
"_source&...
0
votes
1
answer
333
views
Match multi tokens with proximity search between them
Having a large corpus of texts (100k) and a ngrams, examples :
query - get all texts with the tokens ['united' , 'airlines']
I would like to retrieve only texts with a full match of both tokens ('...
0
votes
1
answer
45
views
Elasticsearch exact multiword (array) query for one field
I try to write a query where I have multiple Exact search terms lets say an array of strings
like
["Q4 Test WC Schüssel", "Q4_18 Bankerlampen", "MORE_SEARCHTERMS"]
And I ...
0
votes
0
answers
163
views
elasticsearch nested query with match
I need help implementing a complex search. Below are some pictures to make my question clearer
My Model
As can be seen in the picture, I have a model called company, which contains two objects, ...
0
votes
1
answer
681
views
Elasticsearch Query NOT searching in the specified fields
I am struggling with an elasticsearch query. In the fields option, we have specified '*' which means it should look in all fields as well as given the higher weights to a few fields. But it isn't ...
1
vote
1
answer
616
views
how to perform cosine similarity based semantic search in elastic search query on a text field?
I am performing a match on a text field(skills). I don't want a exact match , instead i want cosine similarity based search on the field.
GET 2/_search
{
"_source": ["Skills"],
...
0
votes
1
answer
548
views
how to match multiple fields inside filter keyword in elastic search query?
I want to add one more field inside match inside function block in my query, but when i am adding, i am getting an error ------ "reason" : "[match] query doesn't support multiple fields,...
-1
votes
1
answer
494
views
Extract elasticsearch query output in csv with java
I'm using java for querying Elasticsearch; I want to export the data of my query in csv file. I'm breaking my head over this.. please can anyone help me with this code? I would be grateful.
This is my ...
0
votes
1
answer
45
views
elasticsearch: problema al consultar a un rango de tiempo definido
I would like to know if there is a way to define a time range as follows.
With a watcher I am looking for records with a certain message within a field. The problem is that I want it to find the ...
0
votes
0
answers
586
views
Elastic Search query for empty date field
Currently I have written the below query for finding null values in historical data for approximately last 4 months in the elastic search:
GET _search
{
"size":2,
"query":{
...
1
vote
0
answers
47
views
Elasticsearch: find closest docs to refence to one by date
Is there a standard seach possibility to find closest docs to one reference doc by date criteria (if I don not know range yet)
Example dataset:
index “person”
- doc : name=>Alice birthday=>01....
0
votes
0
answers
18
views
Elasticsearch is it possible to join folder via conditions?
I have structure
{
id: 1
name: "Root folder"
parent_id: 0,
inherit_folder_id: null,
inherit_permission: false,
permissions: [some permissions]
}, {
id: 2
name: "Accounts&...