Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easy way to find_events that aren't expired? #47

Open
joshbedo opened this issue Feb 14, 2016 · 2 comments
Open

easy way to find_events that aren't expired? #47

joshbedo opened this issue Feb 14, 2016 · 2 comments

Comments

@joshbedo
Copy link

I was looking through the find_events method to check out how it handles expiries and their wasn't an obvious way to pull in all events that haven't expired. Does this exist? something i overlooked?

@grahamjenson
Copy link
Owner

The find_events method should not return expired events, and in the options object you can pass size and page to scroll through the events. Also you can pass a current_datetime object or string that can 'lock' a query to a specific time, so that inserting new data doesnt screw with your paging.

One of my initial assumptions was that there would be millions of events that haven't expired, so I didnt really see the need to pull all unexpired events. What do you need the functionality for?

@joshbedo
Copy link
Author

Awesome that helps, i was thinking I needed to configure something for expiries. I have a getRecommendations method that does the following but I thought i needed to configure it to pull in the non-expired events. Thanks!

  1. find previous non-expired events for the current user id
  2. do events.map((ev) => ev.thing) to get the user ids
  3. Search for users in elasticsearch based on user preferences and exclude users with the previous list of ids

Definitely going to check out the pagination, I'll probably need that later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants