How can I search a database based on multiple, dynamic criteria? -
scenario: i'm building web app pairs programmers, designers, business people, etc. based on user's search criteria.
how can return relevant search results based on criteria entered person searching?
for example: business user searching programmer php, angular, mysql skills.
each skill separate tag (tag1 = php, tag2 = angular, tag 3 = mysql) , each "person" object made of different combination of data.
is there more elegant way query database rather have column in person table each skill , have query run search based on presence of said skill?
i guess rather multiple columns build 1:many relationship between person , skills , return results containing said skills. feel return more rows necessary though.
a more specific example how stackoverflow allows tag question multiple tags...how these tags/questions searched , stored in db?
you don't mention database using. if database handles array-based searches (for example, postgresql does), preferable fixed set of columns searching performance reasons.
now big issue may have synonyms. if searches postgres instead of postgresql?
in 1 of projects repurposed postgresql's full text search this. in case have array of words, turned tsvector, , set of synonyms have normalization of spellings, stemming, synonyms, etc. 1 way address problem requires code (and maybe trigger).
Comments
Post a Comment