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

Why is _script filters commented out in the source code? Possible to add support for scripts? #1660

Open
fabioxgn opened this issue Dec 14, 2023 · 1 comment

Comments

@fabioxgn
Copy link

fabioxgn commented Dec 14, 2023

I'm trying to write a query that compares 2 dates, and my understanding is that I need to use a script filter something like:

Model.search(
  '*',
  where: { status: 'something', _script: "return doc['a'].value.getMillis() > doc['b'].value.getMillis()" },
)

This works and generates a valid filter query if I uncommented the code from here:

# elsif field == :_script

Any reason for this code to be commented out?

@fabioxgn fabioxgn changed the title Why is _script filters is commented out in the source code? Possible to add support for scripts? Why is _script filters commented out in the source code? Possible to add support for scripts? Dec 14, 2023
@fabioxgn
Copy link
Author

fabioxgn commented Dec 15, 2023

There's also an unmerged PR from last year, so I'm not the only one that needs this: #1600

@ankane do we need anything to get that PR merged? I can also send a PR if this requires more changes, but just uncommenting that code works for me.

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

No branches or pull requests

1 participant