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

Filtering #7

Open
MaxBernstetter opened this issue Jun 5, 2023 · 1 comment
Open

Filtering #7

MaxBernstetter opened this issue Jun 5, 2023 · 1 comment

Comments

@MaxBernstetter
Copy link

Hey,

I am having the problem, that the filtering function only matches items which have the exact starting-value compared to the searchvalue. E.g., given this data: ["Apple", "applejuice", "Many apples"], none of these items would match the searchvalue "apple".

Only or the searchvalue "App", the first item would match, and so on...

I forked your repo and would like to edit the functionality so that, the filtering is:

  • Case insensitive
  • Matching a searchvalue also if it is incorporated within a compared value

Can you point me on the correct code-section? I already tried editing the lucene query

From:
`
// Process a string match (fails if the value does not start with the string)
const stringMatch = match("string", (docValue, testValue) => {
return (
!docValue || !docValue?.toLowerCase().startsWith(testValue?.toLowerCase())
);
});

To:
const stringMatch = match("string", (docValue, testValue) => { return ( !docValue || !docValue?.toLowerCase().includes(testValue?.toLowerCase()) ); });
However, had no luck in changing the filtering

Any help would be greatly appreciated :)

@poirazis
Copy link
Owner

poirazis commented Jun 7, 2023

Hello @MaxBernstetter
sorry for the delay !
The Lucene query is not my implementation, i just got it off budibase source.
i haven't figured out how to make it work like an SQL LIKE
If you do find a way, i would love to have it implemented !

For more information you could look at the bb source code of how the Dynamic Filter component uses it
https://github.com/Budibase/budibase/blob/develop/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte

Hope this helps !

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

No branches or pull requests

2 participants