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

Can't make the builder searchWhere use the complete search term!? #5148

Closed
jfoliveira opened this issue Apr 9, 2016 · 2 comments
Closed

Comments

@jfoliveira
Copy link
Contributor

Hi, after struggling trying to search for the exact search term I noticed that src/Database/Builder.php line 29 breaks the search term into words.

Giving that, how could we make OctoberCMS backend search widgets (relation widget, recordfinder widget, list widget, etc) perform a search returning the records containing the complete search term?

E.g.: if the search term is Jon Smith currently the builder retrieves all records containing Jon or Smith. So the search would return:

Jon Doe
John Smith
Jon Smith
Mary Smith
...
  1. How could one make a search returning only records containing Jon Smith?
  2. How could one set a search to return only records starting with Jon Smith?

Am I missing some settings that would make this possible?

Update 2016-04-18:
My previous example was not clear enough. If you have the following rows in your database:

John Smith
Jon Doe
Jon Paul Smith
Jon Smith
Mary Jon Smith
Mary Smith

...

and your search term is Jon Smith then the search would return:

Jon Paul Smith
Jon Smith
Mary Jon Smith

Whereas what I would need is the search to return only two records:

Jon Smith
Mary Jon Smith
@jfoliveira
Copy link
Contributor Author

Is anyone able to help me with this issue? Any ideas?

@daftspunk
Copy link
Member

This has been fixed by adding mode and scope to the list options. See Docs > List for more details.

@LukeTowers LukeTowers transferred this issue from octobercms/library Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants