eec Posted April 9, 2015 Share Posted April 9, 2015 Hi we have product names with "/" and "-" in them (the name has got forward slash in it). I did study the search engine behavior and code and could overwrite the search.php to let me handle the "-" differently and now dash-esh are ok. But appears that forward slashes are making the search string explode, which in our case is not good. I cannot properly search products with "/" in their names. Do you know how can I fix this issue? I need the search not to do anything with slashes and only treat forward slash like any other alphabet or character. Thanks! Link to comment Share on other sites More sharing options...
PascalVG Posted April 10, 2015 Share Posted April 10, 2015 Hi eec, You need to escape the / with a \ Here some more: http://stackoverflow.com/questions/16657152/matching-a-forward-slash-with-a-regex My 2 cents, pascal Link to comment Share on other sites More sharing options...
eec Posted April 10, 2015 Author Share Posted April 10, 2015 Hello Pascal I need to fix this in the search module. but apparently before I can touch the phrase it is getting exploded because of "/" delimiter. How can I stop the search module from changing the search phrase because of "/". I noticed in search.php comments they have removed \x{d} to keep the "dash" or "-" do I need to remove another \x{?} to keep the "/"? I'm not really familiar with drupal classes or how else I can escape the "/" in search phrase in the search.php Thanks Link to comment Share on other sites More sharing options...
eec Posted April 10, 2015 Author Share Posted April 10, 2015 Hello I managed to fix the issue and here is what I have done; in Search.php where they have removed the dash \x{2d} I also removed the x{2f} which is the ASCII code for "/" (forward slash). This way the search code will consider "/" a normal character which is the case in our shop and products. Then in definition of $intersect_array[] where the SQL query is being defined I handled the forward slash also the dash according to our shop's requirement. Open source rocks! Thanks, This issue is SOLVED! Link to comment Share on other sites More sharing options...
max30 Posted April 10, 2015 Share Posted April 10, 2015 Hello eec, I also have product names with a "-" in them. Could you describe in layman's terms how you fixed the issue. Thanks 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