#1071 - Specified key was too long; max key length is 1000 bytes

I had database like picture when i try to create full text search

ALTER TABLE sachgiamgia_books_books ADD INDEX book_fulltextsearch (name,name_khongdau,content(250),content_khongdau(250))

i have error!

#1071 - Specified key was too long; max key length is 1000 bytes

please help me !

Welcome to the SP forums.

255+255+250+250 = 1010
1010 is bigger than 1000

Maybe you could shorten some of those fields?

Thank ! when i try run sql query again

ALTER TABLE sachgiamgia_books_books ADD INDEX book_fulltextsearch (name(100),name_khongdau(100),content(256),content_khongdau(256))

but i have error again. please help me !

was it the same error message? or a different one?

fyi, that’s not actually a fulltext index, it’s just an ordinary index

The same error
#1071 - Specified key was too long; max key length is 1000 bytes r937
@r937 i want to create fulltext index. please help me ! thank you

http://dev.mysql.com/doc/refman/5.1/en/create-index.html

:slight_smile:

sorry @r937 i mean "full text search ". this link that’s about "full text search " ?

that link is not about full text searching, however, it does give the appropriate syntax for declaring a fulltext index

@r937 can you help me about full text seach ?

about statement to create full text seach with tow fields (name,name_khongdau). thank you

i try to run sql query
ALTER TABLE sachgiamgia_books_books ADD FULLTEXT(name,name_khongdau)

and affter that i make select

select concat(name) as name, match(name_khongdau) against(‘manh’) as relevance from sachgiamgia_books_books where match(name_khongdau) against(‘manh’);

i have error .

#1191 - Can’t find FULLTEXT index matching the column list

Please tell me what wrong ? What did i do wrong

you created a fulltext index on two columns, but you wrote your query to match against only one column

Thank you! it worked. :slight_smile:

i have problem agian

i make a sql

SELECT concat( name ) AS name, MATCH (name, name_khongdau) AGAINST (‘dã tràng xe cát’) AS relevance FROM sachgiamgia_books_books WHERE MATCH ( name, name_khongdau ) AGAINST ( ‘dã tràng xe cát’ )

I get result like picture. Please see picture that my problem

i have no idea, sorry