Skip to content

Conversation

@ikslavok
Copy link

@ikslavok ikslavok commented Apr 11, 2025

This PR gives ability to provide aditional option that defines how columns will be filtered when using search functionality.
filterMatchStrategy: 'strict', // strict, fuzzy, tokens

@ikslavok ikslavok changed the title adds serbian translation and abiliti to choose search type adds serbian translation and option to choose search type Apr 11, 2025
@ikslavok ikslavok changed the title adds serbian translation and option to choose search type adds fuzzy search and adds serbian translation Jun 16, 2025
@rmehta
Copy link
Member

rmehta commented Jun 17, 2025

@sokumon can you check?

@iamejaaz iamejaaz changed the title adds fuzzy search and adds serbian translation feat: adds fuzzy search and adds serbian translation Jun 29, 2025
};
}

const filterMatchStrategy = data && data.options && data.options.filterMatchStrategy;
Copy link
Member

@iamejaaz iamejaaz Jun 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const filterMatchStrategy = data && data.options && data.options.filterMatchStrategy;
const filterMatchStrategy = data?.options?.filterMatchStrategy';

}

function guessFilter(keyword = '') {
function guessFilter(keyword = '', data) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only the strategy is used here, then in my opinion, there's no need to pass the whole data object — you can just pass the strategy directly and set its default value to 'strict'

Comment on lines +231 to +242
if (filterMatchStrategy === 'fuzzy' && keyword.includes(' ')) {
return {
type: 'fuzzy',
text: compareString.toLowerCase()
};
}
if (filterMatchStrategy === 'tokens' && keyword.includes(' ')) {
return {
type: 'tokens',
text: compareString.toLowerCase()
};
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference between this and the return statement below is the type value. You could simplify the logic by assigning the type to a variable and defaulting it to 'contains'.

@pReya
Copy link

pReya commented Aug 5, 2025

@ikslavok Thanks for your work. Will you implement the review comments? Would love for this to be merged.

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

Successfully merging this pull request may close these issues.

4 participants