question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to create range filter

See original GitHub issue

I want this:

"range": {
          "@timestamp": {
            "gte": "2014-12-3T16:00:00",
            "lte": "now"
          }
  }

but this code does different thing:

s = Search( using=client, index="my_index" )
s = s.filter( 'range', gte='now-1h', lte='now', field='@timestamp' )
 "range": {
          "field": "@timestamp", 
          "gte": "now-1h", 
          "lte": "now"
 }

@timestamp is put in the wrong place, how to correct it?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
amitpanditacommented, Dec 16, 2014

Hey @garyelephant as far as i understand you are trying to implement a range filter in dsl. You can do something like this:

s.filter(‘range’, **{field_name: {“from”: from_date, “to”: to_date}})

In case you are trying to input the field name and date ranges from variables.

You can also replace lte and gte instead of from and to

0reactions
honzakralcommented, Jan 16, 2015

I still don’t see how we could implement this consistently so I am closing the ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filter data in a range or table - Microsoft Support
Select any cell within the range. · Select Data > Filter. Filter button · Select the column header arrow Filter arrow . ·...
Read more >
JetSmartFilters: How to Create Range Filter - Crocoblock
How to create Range filter ... Go to WordPress Dashboard > Smart Filters and click the “Add New” button. Fill out the Title,...
Read more >
Range filter—Help | ArcGIS for Desktop
Follow the steps below to set the Range filter on a model parameter: In the Catalog window or ArcToolbox window, right-click the model...
Read more >
Range Filter
Range Filter · Right-click on the range filter to bring up the pop-up menu. · Select Filtering Scheme Properties. · Under Filter settings,...
Read more >
Creating a Numeric Range Filter - Anzo® 5.3 Documentation
Creating a Numeric Range Filter · Open the Dashboard that you want to add the filter to. · In the Hi-Res Analytics main...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found