Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Smart search add two %% to the end of the search value #3144

Open
Rafeethu opened this issue May 18, 2024 · 1 comment
Open

Smart search add two %% to the end of the search value #3144

Rafeethu opened this issue May 18, 2024 · 1 comment

Comments

@Rafeethu
Copy link

Summary of problem or feature request

if smart search is true and starts_with is false adds two % characters to the end of the search value. if we enable starts_with to true still the search value has a % character in the beginning of the search value.

I think this is caused by the following

  1. setupKeyword function [
    https://github.com/yajra/laravel-datatables/blob/b1849508ca5dcabb6f375e45d9f00dbb94b79082/src/DataTableAbstract.php#L931] considers only smart search
  2. prepareKeyword function [https://github.com/yajra/laravel-datatables/blob/b1849508ca5dcabb6f375e45d9f00dbb94b79082/src/QueryDataTable.php#L481] consider both smart and starts_with

But both functions are called and this add two %% to end.

I assume setupKeyword function also should consider starts_with config option.

image

Also what does smart search do, does is enable searching for contains in a string value?

System details

  • Operating System
  • 8.1
  • 6
  • 9.11
@github-actions github-actions bot added the stale label Jun 18, 2024
Repository owner deleted a comment from github-actions bot Jun 18, 2024
@yajra yajra added pinned and removed stale labels Jun 18, 2024
@yajra
Copy link
Owner

yajra commented Aug 17, 2024

@Rafeethu thanks for reporting, please do not hesitate to submit a PR if possible.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants