Djam wrote:
I need your help to build a dictionary on mysal database to have an
efficient keyword search engine.
Do you mean dictionary which
1) explain what each word mean or
2) dictionary which translates word from one language to another ?
# 1):
create table dictionary( word varchar(255), description text );
create index dictionary_index on dictionary( word(10) );
# 2):
create table dictionary( word varchar(255), word2 varchar(255) );
create index dictionary_index on dictionary( word(10) );
create index dictionary_index2 on dictionary( word2(10) );
You can increase the number 10 with the cost of disk space and advantage
of getting faster queries, if you got many words that have 10 first
characters the same.
When searching for given word, for example 'car', search with
select * from dictionary where word like 'car%';
Also, it might be smart not to commit search if only 1 or 2 characters
are inputted, depending on the size of your table (because the amount of
matches might be huge).