Questions tagged [range-query]

95 questions
3
votes
1 answer

How to do high dimensional range query with fixed range?

I have about 10^4 points in 7 dimensional space. For a certain application, I need to make ~10^6 range queries on this input to find all the points that lie inside a given range. In this application, all the queries use the same range size. What is…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
2
votes
1 answer

Efficient data structure for storing precomputed maximums

Consider this table that stores the value of two stock variables A and B at each point in time: A B day 1 10 0 day 2 0 10 day 3 7 7 day 4 7 7 We want to answer questions like: What was the maximum value achieved by…
danidiaz
  • 26,936
  • 4
  • 45
  • 95
2
votes
1 answer

how do range queries work on a LSM (log structure merge tree)?

Recently I've been studying common indexing structures in databases, such as B+-trees and LSM. I have a solid handle on how point reads/writes/deletes/compaction would work in an LSM. For example (in RocksDB/levelDB), on a point query read we…
shinjin
  • 354
  • 4
  • 17
2
votes
3 answers

Segment tree with lazy propagation - Multiply all values in a range

I have the following code which for segment tree with lazy propagation which I could manage to write. This code does not work for multiplying all numbers in a range with a value, say x. I think I am doing something incorrect in the update_mult…
Aakash Anuj
  • 3,773
  • 7
  • 35
  • 47
2
votes
1 answer

tsrange range error on DST transition values

I have a problem with saving values of type tsrange in PostgreSQL when only one of the intervals is in daylight saving time and the interval is less than 1 hour long. For example I want to save a 45 minutes long time range ["2013-03-09…
Peter
  • 580
  • 8
  • 22
2
votes
2 answers

Range query with elasticsearch for string

I am trying use range query with elasticsearch { "query": { "range": { "order_no": { "gte": "VM-0001", "lte": "VM-0005" } } } } But elastic return no result. I…
hoangvu68
  • 845
  • 2
  • 13
  • 28
2
votes
1 answer

Aggregate Date Range filtered values in elastic search

I need to filter a group of values based on date (added field here) and then group it by device_id. So I am using the following thing : { "aggs":{ "dates_between":{ "filter": { "range" : { "added" : { …
Happy Coder
  • 4,255
  • 13
  • 75
  • 152
2
votes
1 answer

Lucene 2.4.0 Range Query is not working as expected

Below are the indexed fields with value: EffectiveDate="1970" ExpirationDate="2035" Code to create index and seach: public class IndexTest{ static Analyzer analyzer = new StandardAnalyzer(); static IndexSearcher isearcher; @BeforeClass public…
NaveenKumar1410
  • 1,565
  • 14
  • 20
2
votes
1 answer

elasticsearch query dates by range

My elasticsearch has data, particularly something like this for dates: { "startTime": { "type": "string", "format": "yyyy/MM/dd", "index": "analyzed", "analyzer": "keyword" } } I am adding a date range picker and want to use the…
cdietschrun
  • 1,623
  • 6
  • 23
  • 39
1
vote
1 answer

Nested Query with Date Range

I'm wondering if somebody can confirm if the query I've constructed is correct. I have a User mapping that has Transaction nested within the user and I'm looking for Users that bought a specific item before a date. Also, within a Transaction I also…
hastinc
  • 23
  • 3
1
vote
1 answer

Number of elements less than 'x' in a range (l, r) both inclusive

Given an array of integers, and there is a single type of query. Query - (L, R, X) Find the elements less than 'X' in the range (L, R) both inclusive. PS: all the queries are provided before hand i.e. we need to devise an offline algorithm to answer…
Ajay Singh
  • 161
  • 1
  • 1
  • 8
1
vote
0 answers

MarkLogic: How to manage additional query in constraint

MarkLogic 9.0.8 On UI, apart from search text, few filters are applied including publish date year. As we can't control how end user will write query in multiline textbox. So at end query look like something AU:Manish AND PY:>=2001 AND CT:Control…
Manish Joisar
  • 1,256
  • 3
  • 23
  • 47
1
vote
0 answers

Elasticsearch range query slow matching when combined with a specific filter

I'm trying to figure out why our new cluster is slow and found some weird things. When executing this: { "query": { "bool": { "filter": [ { "term": { "reference_id": 4489 } }, { "range": { "created_at": { "gte":…
Linus
  • 2,799
  • 3
  • 29
  • 43
1
vote
3 answers

How to query if a time is between two field values

How do I search for documents that are between a start and end time? For example, I want to query the following document using a time only like "18:33" or "21:32". "18:33" would return the following document and "21:32" wouldn't. I don't care…
spottedmahn
  • 14,823
  • 13
  • 108
  • 178
1
vote
1 answer

Are "from" and "gte"/"gt" equivalent in range query in ElasticSearch?

I've just discovered that a package that I use for ElasticSearch operations https://github.com/olivere/elastic creates the following range queries with from, to, include_lower and include_upper tags: "query": { "range": { "myfield": { …
Patryk
  • 22,602
  • 44
  • 128
  • 244