ankane/searchkick

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

fabioxgn opened this issue · 2 comments

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?

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.

Added support in the commit above.