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

Implement QueryDSL filter #7081

Closed
2 tasks
ComLock opened this issue Apr 15, 2019 · 13 comments
Closed
2 tasks

Implement QueryDSL filter #7081

ComLock opened this issue Apr 15, 2019 · 13 comments
Assignees
Labels
Milestone

Comments

@ComLock
Copy link
Member

ComLock commented Apr 15, 2019

To filter on dateRanges you currently have to build range queries using instant('...').

It would probably be much more efficient to have a dateRange filter instead.

Also it would make implementing dataRange facets much easier codewise.

  • support filter in query
  • support exists expression
@sigdestad
Copy link
Member

Do you have a specific example of what you want this too look like?

@sigdestad
Copy link
Member

Ping?

@ComLock
Copy link
Member Author

ComLock commented Jan 10, 2020

@alansemenov alansemenov added the To Be Discussed Issues that require additional discussion label Apr 29, 2020
@alansemenov
Copy link
Member

Have to be researched and spec'ed.

@rymsha
Copy link
Contributor

rymsha commented Apr 29, 2020

lib is simply missing range filters. We had a sort discussion about it recently, and it is not that hard to implement (I see not challenges) and it allows users to fetch data in portions.

We use range filters extensively in internal XP methods.

@ComLock
Copy link
Member Author

ComLock commented May 8, 2020

Doc: https://developer.enonic.com/docs/xp/stable/api/lib-content#query

From the top of my head

filters: {
  boolean: {
    must: [{
      dateRange: {
        field: 'created',
        ranges: [{
          from: 'now-1D',
          to: 'now'
        }]
      }
    }]
  }
}

@rymsha rymsha added Feature and removed Improvement To Be Discussed Issues that require additional discussion labels Jan 4, 2021
@anatol-sialitski anatol-sialitski self-assigned this Jan 6, 2021
@rymsha
Copy link
Contributor

rymsha commented Jan 7, 2021

We made an experiment with range filter and it didn't go very well.

filters are made as json-type structures, and this makes them more attractive for use, but unfortunately it makes them more hard/impossible to use as well in cases where data type knowledge is required.
One cannot proper date range on 'created' field as this filed has term index, not datetime.
Instead one would have to use created._datetime "implementation detail" field - that would be a disaster.
Query Language has an extensive set of functions to deal with it, but an opposite request exists #4980 because, as you mentioned, it is hard to construct query string properly.

@sigdestad
Copy link
Member

when using a date filter, shouldn't we implicitly use the _datetime value in ES? Just like we do in other scenarios?

@sigdestad
Copy link
Member

Does anyone know the status of this issue? Will we support this?

@rymsha rymsha added this to the 7.9.0 milestone Dec 15, 2021
@vbradnitski
Copy link
Contributor

vbradnitski commented Dec 15, 2021

We can do date range queries in the new Query DSL epic. One of the next steps - to rewrite current filters to the same code base. So it potentially can be done in the same (or similar) syntax for filters.

@rymsha rymsha removed this from the 7.9.0 milestone Mar 3, 2022
@rymsha rymsha added this to the 7.11.0 milestone Jun 30, 2022
@rymsha rymsha changed the title dateRange query filter query filter Jun 30, 2022
@rymsha
Copy link
Contributor

rymsha commented Jun 30, 2022

Renamed task to "query filter" because date range in automatically implemented as filters are implemented.

In addition we need to implement exists expression https://www.elastic.co/guide/en/elasticsearch/reference/2.4/query-dsl-exists-query.html

vbradnitski added a commit that referenced this issue Jul 20, 2022
vbradnitski added a commit that referenced this issue Jul 20, 2022
@alansemenov alansemenov changed the title query filter Implement QueryDSL filter Jul 25, 2022
rymsha pushed a commit that referenced this issue Jul 27, 2022
@rymsha
Copy link
Contributor

rymsha commented Aug 2, 2022

exists is a separate feature #9603

@jsi jsi closed this as completed Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants