davo Posted October 14, 2014 Share Posted October 14, 2014 I'm using the following for a search query $matches = $pages->find("Meta_keywords|DMCcontact_Country|DMCcontact_Address_2|DMC_Email%=$q, template=dmc, limit=50"); The problem I have is it's picking up parts of words within other words like this: oman, brings back romania Any ideas how i could improve this? David Link to comment Share on other sites More sharing options...
teppo Posted October 15, 2014 Share Posted October 15, 2014 If the problem is that you're getting too many results, have you tried using other operators, such as *=, instead of %=? 1 Link to comment Share on other sites More sharing options...
davo Posted October 15, 2014 Author Share Posted October 15, 2014 Thanks teppo. I have tried the other operators but I can't find anything that matches exactly right. Partly my fault I guess for not organising the data properly in the first place. The perfect example is as above: it finds a page with 'Oman' on the 'Romania' because it contains the word r Oman ia I did think about adding a space after the query like this $q =$q . " " But that would then exclude the words or my keyword field which are going to have a comma directly after them. I guess I could make up two instances to search for, one with a comma appended and one with a space. Link to comment Share on other sites More sharing options...
Soma Posted October 15, 2014 Share Posted October 15, 2014 Use ~= 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now