The answer to your IT questions
 

Advanced search  • Search tips
My QUESTIONS & ANSWERS
 Question:
Home » Database » MySQL :

how can we use lucene indexing in mysql

User Asked by: superhornet
Published on: 16:46/19.02.2009
Status: OPEN
Hi,
I am trying to index a mysql column through Lucene can someone tell me how to do it and if it possible.

Regards,
Superhornet
 Answers: 1
Sort by: /\ date | rating
Image Answer by: xpert
Posted on: 15:46/19.02.2009
Rating: 2.5 from possible 5 with 2 votes
The question is not quite correct. Lucene text search and mysql text search are different technoligies. You have to decide which one to use. If you want to use Mysql fulltext search you have to create table with MyIsam engine and Fulltext index like this:


CREATE TABLE IF NOT EXISTS my_test_tbl
(
   doc_num INT(3),
   txt_title varchar(100), 
   txt_detail varchar(200) ,
   FULLTEXT (txt_title,txt_detail)
) ENGINE=MyISAM


Then insert test data into it:

insert into my_test_tbl(doc_num, txt_title, txt_detail)
values (1,'fox baby river', 'fox brown river baby chair');

insert into my_test_tbl(doc_num, txt_title, txt_detail)
values (2,'sugar man river', 'sugar man river baby chair');


Then you make the query:

SELECT doc_num FROM my_test_tbl
WHERE MATCH (txt_title, txt_detail) AGAINST ('fox' in boolean mode);


I just have to see what is the configuration of mysql server.

Refine your question. Lucene is java and has nothing to do with mysql, it can work together with mysql but also can run without mysql. What is your exact question ?

Maybe you want Lucene to index data which is stored in MySQL ? Is is what you want ?

Vote:

Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
  
| Home | Hall of fame | Register | Log in | Terms of service | Help | Contacts |