MySQL Forums
Forum List  »  Newbie

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

Quote

they are stored as numbers without the mm, so if someone searches for 21mm x 38mm it still wont match because the actual ProductName is 38mm x 21mm, the value in the length field is for example 21 not 21mm and the same for the height field.

Indeed, so you need to store units also, and map the user's search elements to those columns, eg given that a user entered "38mm x 21 mm" ...

- remove spaces
- extract the numeric values
- if there aren't two, bitch and return to the input screen
- look for unit symbols like 'mm', add defaults if missing or bitch & return if defaults aren't available

then search for len,len_units,wid,wid_units, also the reverse if the input did not specify which is which and if the input spec must allow such ambiguity.

Options: ReplyQuote


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


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.