Forum Moderators: coopster
I am building a small search engine for a website, to allow users to search photos there - either by photo name, photo description or photo tags.
My problem is that results are somewhat messed if the search term is small enough to belong to many words with diferent meanings.
for example:
i search the term "ios", which is a greek island
in my results i find photos marked with tag "agios", which means 'saint' in greek.
Is there a way to avoid such silly results? I dont want to limit the minimum characters beacause i will loose many usefull keywords
My queries look like this:
SELECT field FROM table WHERE LOWER(tag_field) LIKE '%$keyword%'
- $keyword is the search term, in lowercase
- tag_field has comma seperated words used as tags
- i have 2 more queries for photo name and photo description
SELECT field FROM table WHERE LOWER(tag_field) LIKE '% $keyword %'
I would play with that to be sure it produced the desired results though, you could look at regexp in queries but speed may become an issue. You could look at putting spaces around the field value as well if that normalized the search results