Questions tagged [range-query]

95 questions
0
votes
2 answers

Count the number of occurrences of a character in a string for a number of queries?

I want to find the occurrences of a character in a string for n queries: For example the string is: "i_love_mathematics" and the task is to find the occurrence of: 'i' in range: 1-4(a substring starting from 1st character and ending at…
aroma
  • 1,370
  • 1
  • 15
  • 30
0
votes
1 answer

Finding a range satisfying a property in faster than linear time

Given an array A[] we need to find a range which has the maximum size and its minimum element is >= 1. We also need to update this range by decreasing all its elements by 1. One idea I got is to keep a segment tree for efficient updates. But how do…
Ivankovich
  • 119
  • 2
  • 8
0
votes
0 answers

Strong parentheses sequence

I have a problem which is shown here. Can someone please suggest an approach for this problem? I looked up the editorial and it said we were supposed to create a tree for each range and treat it as a node.I am not able to understand this concept and…
0
votes
1 answer

Text Range example [AbA-Ef] - how do I interpret it?

I am preparing for interviews and am trying to understand this problem: Write a program to track set of text ranges. Start point and end point will be string. Text range example : [AbA-Ef] Aa would fall before this range AB would fall inside this…
Generic Person
  • 351
  • 1
  • 5
  • 10
0
votes
0 answers

Range query not formatted properly? (Elasticsearch)

I am using the python elastic search client to query my elasticsearch index. My index is very small, because I am trying to deduce where my query is going wrong. Here is an example entry _source: { Expiration: 20160115 } and another _source: { …
Zack
  • 13,454
  • 24
  • 75
  • 113
0
votes
1 answer

ElasticSearch comparative range results

Hi I would like to index objects that look like that { uuid: "123", clauses: [{ order: 1, uuid: "345"},{ order: 2, uuid: "567"},{ order: 3, uuid: "789"}] } Is there a way to write a query that matches all the objects that contain clauses…
Michail Michailidis
  • 11,792
  • 6
  • 63
  • 106
0
votes
1 answer

Lucene date range with multiple occurrences

I'm writing an application for doctors planning. A doctor is a Java object having an ID, a name and a collection of plannings. A planning is described by {start_date, end_date, planning_type}. Dates are formatted as YYYY-MM-DD. Now, consider doctor…
SBA
  • 113
  • 10
0
votes
2 answers

Optimize a segment tree for range maximum queries?

So I need some help again.I recently started doing medium level problems on codechef and hence I am getting TLE quite a lot. So basically the question is to find the sum of of multiple maximum range queries given in the question.The initial range is…
gospelslide
  • 179
  • 2
  • 2
  • 12
0
votes
1 answer

MarkLogic Range Query

Hello MarkLogic experts, Could you please advice how to achieve the below sample results using MarkLogic range query. XML apple
0
votes
1 answer

Alphanumeric range query

Is there an effective way to handle alphanumeric ranges in lucene? Example ranges, 1 to 1 (includes 1A, 1B.. 1Z) 10A12 to 10A22 (includes 10A12, 10A13.. 120A22) 1 to 10 (includes 1A,1B..,2A,2B..,9Z,10) [Does not include 10A] I have two…
Sathish Kumar
  • 87
  • 1
  • 6
0
votes
1 answer

Range COUNT query Based on DATE from epoch timestamp in Hibernate

i have a table in postgres which is indexed by epoch timestamp....now i want to query this table to get count of no of events between particular dates... i have made a query for it in postgres but i am not sure how can i achieve this in hibernate…
Asav Patel
  • 1,113
  • 1
  • 7
  • 25
0
votes
0 answers

Range query with no dups

I have a collection that I would like to serve out as 'pages'. The collection could get quite large, I have read skip is not optimal in that case. I think range queries will work just fine in my case so I am going to try that route. My collection…
lostintranslation
  • 23,756
  • 50
  • 159
  • 262
0
votes
1 answer

Does Riak support Range Queries over binary safe strings?

Coming from Redis, I love that you can just put any binary blob in Redis which is just treated as a string. This is possible because Redis strings are what they call 'binary safe'. This makes it possible to do stuff like rangequeries on top of…
Geert-Jan
  • 18,623
  • 16
  • 75
  • 137
0
votes
1 answer

how to extract neo4j data with range query

I am new to neo4j.I need to extract first 5 million or any range of 5 million data with relationship from this 20 millions dataset.I have been struggling to run range query on my data. If I can extract the data and again import to neo4j it would be…
sky
  • 25
  • 5
0
votes
0 answers

Range Querying with Dynamic Composites

Can somebody explains what is going on with this example. My CF has one single row (key is a string: manju) which in turn has one single column. The column name is dynamic composite with two components: ("review","T23333"). The value is the boolean…
Pee One
  • 3
  • 3