Note: If your don’t need to store keyword frequency, then go with Marmik Bhatt’s LIKE suggestion.
If you have large amount of data and you want to do a keyword search only (i.e. you are not going to be searching for phrases or use concepts like “near”), then you can simply create a keyword table:
CREATE TABLE address You then scan through the text that you are “indexing” and count each word that you find there.
If you want to do several keywords:
SELECT address.*, SUM(frequency) frequency_sum Here i’ve done a frequency sum, which can be a dirty way to compare the usefulness of the result, when many are given.
Things to think about:
|
|
|
For search engine, I use ‘LIKE’ to search parameters… The query would look like…
SELECT * FROM tbl_keywords $keyword is a variable retried from GET or POST request from the search bar.
You can also use JSON output of your search result so, using jquery you can provide fast search result output.
|
|
|