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

Scipted query #2968

Open
p-migda opened this issue Aug 20, 2024 · 1 comment
Open

Scipted query #2968

p-migda opened this issue Aug 20, 2024 · 1 comment
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@p-migda
Copy link

p-migda commented Aug 20, 2024

Hi,
Is there any possible way to make something like this using criteria query without runtime or scripted field?

GET index/_search { "query": { "bool": { "must": [ { "nested": { "path": "date", "query": { "bool": { "filter": { "script": { "script": """ ZonedDateTime date = doc['date.date'].value; ZonedDateTime now = params['now']; return date.isBefore(now) """ } } } } } }, { "bool": { "must": [ { "match": { "fieldName": "value" } } ] } } ] } } }

I'm thinking about method something like that
criteria.addScriptedQuery(String script, HashMap<String, Object> params);
Do you think it is possible to make something like this or maybe it is possible already?

edit:
Or run stored script on es in query?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 20, 2024
@sothawo
Copy link
Collaborator

sothawo commented Aug 21, 2024

Currently this is not possible. This will need some investigation of how it might be integrated int the critera API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants