When I was working on a company project today, I encountered a problem:
We hope to determine whether the user has added keywords unique to this column (such as "tutorial") when searching in the secondary column. Because we are searching the entire site, if no keywords are added, the search results will be It’s a lot and very complicated, so we just want to search for all tutorial-related things under the tutorial column, so we thought a little bit more and made some small changes to the search keywords. The code is as follows:
Just use this code. When we search for CSS tutorials, the program will judge that the package does not contain it and will not splice the word "tutorial" into the keyword. When we search for CSS, it will splice it into " Searched for "CSS tutorial".
OK, I hope I can give you some help.