MySQL Forums
Forum List  »  Newbie

Re: broad match search results, splitting the search by spaces
Posted by: Peter Brawley
Date: November 11, 2014 12:54PM

Searches for substrings with variables numbers of spaces and various orders of substring values will be slow and imprecise at best.

I think the best solution is to encode that info in the record when it's entered, ie if "38mm x 21mm" means that the item is 38mm wide and 21mm deep, the code that takes in new or edited descriptions populates columns width, width_units, depth, depth units with the values 38, 'mm', 21, 'mm' respectively. Now when users search for "38mm x 21mm", you use that same code to parse it for width and height, and search for those. The results will be fast.

Options: ReplyQuote


Subject
Written By
Posted
Re: broad match search results, splitting the search by spaces
November 11, 2014 12:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.