Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your schema is fine. But it sounds like what the user wants at a minimum is: 1. A google-style free-form text field which they can just type in words, but... 2. Which brings up a subset of matching results in a combo-style fashion.</p> <p>So here's the deal: Search-like capability isn't what relational databases are designed for, and that's basically the problem you're running into. That said, MySQL, while not my domain of expertise, does seem to have reasonable full-text search support (<a href="http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html" rel="nofollow noreferrer">MySQL Full Text Search</a>).</p> <p>Perhaps you <em>could</em> have FULLTEXT indices on each of the description fields and issue five different queries. Or if you're willing to go with a dirty solution, have a separate BUSINESS_SEARCH(business_id, concat_description) where concat_description is just all of the related "description" fields munged together; though you'll need to account for description updates.</p> <p>But I have no idea what the performance implications are with FULLTEXT. If it's non-trivial, I'd offload these queries to a separate copy of the server.</p> <p>My personal feeling--completely without evidence to back it up--is that you'll run into performance problems down the road. Have you considered an add-on? A quick google search-engine shows <a href="https://stackoverflow.com/questions/502238/google-like-search-engine-in-php-mysql">Google-like Search Engine in PHP/mySQL</a>. The big downside is that you're introducing all of the pitfalls of yet an unproven/unfamiliar technology.</p> <p>For either approach, I think you have some research cut out for you.</p> <p>Good luck!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload