469,641 Members | 1,149 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,641 developers. It's quick & easy.

Build a dictionary...

Hi,
I need your help to build a dictionary on mysal database to have an
efficient keyword search engine.

Thanks :-)

Djam
Jul 23 '05 #1
1 1787
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).
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by none | last post: by
1 post views Thread by john wright | last post: by
16 posts views Thread by Podi | last post: by
1 post views Thread by hermesbaby | last post: by
11 posts views Thread by MonkeeSage | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.