rondelli Posted December 3, 2009 Share Posted December 3, 2009 Look guys, I`m trying to build something here but have absolutely no idea where to start. Basically I want to build a user text input form, where a user can type some text and after submitting the form, my php program will fetch the text, search the text for key words and output a list of possible categories. So per say let`s say the user type`s something like: I would like to buy a car. In my mysql db I will have a table CATEGORY like : id_cat(TINYINT PK NOT NULL UNSG), descr(VARCHAR NOT NULL), tags(??????). The tags data type(I need your help here, cause I don`t exactly know of a "list" data type in MySQL and the ENUM Type will only contain one word per assignment, i need an array of strings) will contain a list of words like: car, auto, etc. . After the query is done, my program should say something like this: "Hey so this guy is looking for automobiles (CATEGORY TABLE) because I found that the word "car" matches with a value stored in the ???data type in the column TAGS in the CATEGORY TABLE. Any help is appreciated Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 3, 2009 Share Posted December 3, 2009 hai i think u are trying to build a search engine basically with the categories. just check with the following possibilities sphider--www.sphider.eu/ and phpdig--www.phpdig.net/ just run through the query and modify accordingly Quote Link to comment Share on other sites More sharing options...
rondelli Posted December 3, 2009 Author Share Posted December 3, 2009 It`s not that simple. Later on I`ll implement a natural language analysis program so I want my "current" program to search the text for keywords. Keywords that reside in the Category Table in MySql table. So I want my program to look for keywords based in my MySql table. Further I need your help to tell me what data type should I use for the tags. Do you think I should use a data type like set(but that dosen`t imply normalization) or a separate table like: Category tag id_cat id_tag id_tag tag description instead of: Category id_cat description tag ????? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 3, 2009 Share Posted December 3, 2009 the present search engines that are build up are the ones which will blindly search for any word that have been given up but not with any keyword.. so basically what u need is that u need to store ur search string into some place and then fetch each word of it, then u need to search each word matching with the keyword library that u have build up. when i am saying abt the library it should be quite huge.... so when a match applies it should navigate to the particular category, but the possible problem that would come in here is that take ur own sentence i would like to buy a car... in this u can have two categories like one is that of buy, so under buy u can have sub category like automobiles and so on,, so u should use a indexing system for this to happen.. definitely i would like to help u on this development, u can contact me at my email address which is given in my site.. Quote Link to comment Share on other sites More sharing options...
rondelli Posted December 3, 2009 Author Share Posted December 3, 2009 your right on the track...but i`ll keep it simple for now. I`ve sent you an email, so if u`re interested please reply asap Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.