-
Notifications
You must be signed in to change notification settings - Fork 314
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
Allow custom queries in painless scripting language #1748
base: develop
Are you sure you want to change the base?
Conversation
@sebumd this is interesting. Assuming it works and @tott and @brandwaffle, are okay with it. I think we can add this. However, first please run your PR through PHPCS as there are some issues. |
@tlovett1 thanks! I fixed the PHPCS issue. @tott @brandwaffle what's the process to get this tested, approved and released for ElasticPress? Right now I'm using a hacked version of the module in production and would like to be able to include this feature and update to the latest when it comes out. |
Hi @sebumd. I would like to review this PR. Could you provide more information to test it? I've tried but looks like the filter is not applied. |
@Rahmon This is how I'm using it myself:
|
This allows the user to write a custom query in the painless scripting language https://www.elastic.co/guide/en/elasticsearch/painless/current/index.html.
For example, to search for a post by meta.birthday for all people born in March, you can use the following code:
$args['custom_query'][] = "doc['meta.birthday'].value.getMonthValue() == 3";