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

Feature Request: Enhance ODataFilter Class to Support OR Operator with Functions #753

Open
michaelschoenbaechler opened this issue Sep 4, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@michaelschoenbaechler
Copy link

Is your feature request related to a problem? Please describe.

Currently, it seems like the ODataFilter class doesn't support the usage of OR operators between different functions, which limits the filtering capabilities, especially when I want to perform string searches across multiple properties.

Describe the solution you'd like

I propose an enhancement in the ODataFilter class to support the OR operator between functions, making it possible to search a string in multiple properties simultaneously. This can be done by extending the existing methods or creating new methods to accommodate this functionality. The goal is to enable queries that look like this:

// Query should be able to support filters like:
// "substringof('test', CompanyName) eq true or substringof('test', CompanyDescription)"
OData
  .newFilter()
  .property("substringof('test', CompanyName)").eq(true)
  .or()
  .property("substringof('test', CompanyDescription)").eq(true)
  .build();

Describe alternatives you've considered

An alternative could be writing a custom function to handle these types of queries outside of the ODataFilter class. However, integrating this feature directly into the ODataFilter class would provide a more streamlined and native experience for the users.

Additional context

This feature enhancement would improve the flexibility and capabilities of the ODataFilter class, allowing for more complex and nuanced queries, especially when dealing with string searches across different properties.

@Soontao
Copy link
Owner

Soontao commented Sep 6, 2023

sure, I'll check this later

@phelipealves
Copy link

Hi @Soontao, any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants