Questions tagged [range-query]
95 questions
1
vote
0 answers
To find expected value after performing some operations on array
I find problems in solving these kinds of questions
Suppose there is an array A[1....n] and we can perform two kinds of operations on the array:
Randomly Select Two Indexes p and q with p < q then swap A[p] with A[q]
Randomly Select Two Indexes p…

jaig
- 107
- 2
- 2
- 6
0
votes
0 answers
Elastic range query with range greater than a particular day of month
I want to do a query using a range where in timestamp date is greater than , say 10th of the month (month in which query is being run) and less than now ( Time when query is being run) . I keep getting following exception when I run my query…

user20984815
- 1
- 1
0
votes
0 answers
Range query question on fenwick/binary indexed tree
So I have an integer array in which I need to find the sum between range L to R
Also I need to add some value x(int) to range L to R i.e update operation.
I have solved these questions using fenwick tree range sum/update queries but this problem is…

Madhav mishra
- 313
- 4
- 20
0
votes
1 answer
elasticsearch-6.8.13, Multi Match Range Query is not working
I am using the ElasticSearch custom DSLs & want to use the query to find the accommodations that have adults gte [:adults] & lte [:perfect_adults]. Its not working even if we used the static values using this formal docs of elastic…

Abdullah Zafar
- 171
- 8
0
votes
1 answer
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 interface but for version 7.15.2. The problem here is,…

Pangaeanain
- 37
- 1
- 6
0
votes
1 answer
CSES range query section question salary queries problem
I am trying to solve cses salary queries (https://cses.fi/problemset/task/1144/)
Question: I will make a frequency array of salaries and I will use coordinate compression but while update I have to rebuild coordinate compression and there will be a…
0
votes
1 answer
Efficient query for finding an element in a range
I face a problem, where I need to find a specific pairwise sum where the first element from the index has index > i.
Example:
[1, 2, 3, 4, 6] (index 0 to 4)
target_sum = 9
Now, from this array I need to find a pairwise sum where the first element…

Zabir Al Nazi
- 10,298
- 4
- 33
- 60
0
votes
0 answers
2D circular range search (find all points in circle) library for python?
So the problem is following: given N points in a database (edit: just assume for the moment it's 2 arrays x[] and y[]), each with coordinate (x[i], y[i]), and queries with format (X,Y,R), list all points in the circle with center (X,Y), radius…

Duke Le
- 332
- 3
- 14
0
votes
1 answer
Rails querying across midnight with time only column
I'm using Rails 6.0.2 and MySQl version 5.7.
On the camera_events table I have a start_time and an end_time column that are both time datatypes as I do not need the date, i just need to know when the event starts and when it ends.
I am trying to…

Tony Petruzzi
- 99
- 3
0
votes
2 answers
Lucene LongPoint Range search doesn't work
I am using Lucene 8.2.0 in Java 11.
I am trying to index a Long value so that I can filter by it using a range query, for example like so: +my_range_field:[1 TO 200]. However, any variant of that, even my_range_field:[* TO *], returns 0 results in…

Yanick Nedderhoff
- 1,174
- 3
- 18
- 35
0
votes
1 answer
Elastic Search count between dates
I have elastic search and kibana version 7.X
I have a document with date fields:
start_date
end_date
created_at
I wanted to get the number of people I have in my database by month --> A line chart with x-axis date histogram and count on y-axis…

mushood badulla
- 1,043
- 1
- 12
- 19
0
votes
1 answer
match closest number value elasticsearchDSL(php)
I'm having trouble finding an answer on SO, elastic search docs, or google to find this answer for my use case:
Find the closest number to X input that is still lower then X.
I have a mapping that looks like this:
{
"rule": {
…

rootshelled
- 15
- 5
0
votes
0 answers
Count of set bits at an index in a given range
I could not find any such query. Given a range and the index i, we want to count the numbers in the range that have bit i set.
Eg, range=[6,13] and i=2, ans=4
6 0110
7 0111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
Is there a better approach…

Madhuram Jajoo
- 1
- 1
- 1
0
votes
0 answers
Format dates in response field in elastic search
My server on which the application runs (uses ES) and ES are in central american time and I am accessing it from my server which is in IST.
I want some charts and data for today(Say Jan 3) so I send from date as today 12:00 AM to to date as current…

SRI SUSHMA Karra
- 21
- 8
0
votes
2 answers
range search algorithm for querying shapes in 2D plane that are in the given region
General problem statement:
Design on-canvas shape selection engine
Given:
Arbitrary convex shapes on the 2D plane.
( say represted by std::vector < IShape* >, IShape has getBBox() member )
Question:
Find and return collection/subset of shapes…

libxelar.so
- 473
- 4
- 16