watts Posted October 30, 2006 Share Posted October 30, 2006 Hello,I am trying to add a full-text search to my site but when I tried to create a full-text index in my db I got the message, "#1071 - Specified key was too long; max key length is 1000 bytes"Can anyone tell me what this means and how to deal with it?Any suggestions would be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/25533-problems-creating-full-text-index/ Share on other sites More sharing options...
toplay Posted October 30, 2006 Share Posted October 30, 2006 The problem is pretty much what it says.Have you tried googling it before posting:http://www.xaprb.com/blog/2006/04/17/max-key-length-in-mysql/http://bugs.mysql.com/bug.php?id=4541http://forums.mysql.com/read.php?25,68461,68461 Quote Link to comment https://forums.phpfreaks.com/topic/25533-problems-creating-full-text-index/#findComment-116523 Share on other sites More sharing options...
watts Posted October 30, 2006 Author Share Posted October 30, 2006 Thanks for these links. I've looked over them and I'm not sure what that means I should do. I haven't gotten this error in the process of creating the table in the first place only when I try to create a full-text index. I tested and I can see that when I only put one field in the index and it's a short field I don't get the error. The question is, what if I want to do full-text search with multiple fields involving a larger field? Is this impossible? Quote Link to comment https://forums.phpfreaks.com/topic/25533-problems-creating-full-text-index/#findComment-116549 Share on other sites More sharing options...
fenway Posted October 30, 2006 Share Posted October 30, 2006 Post your table structure. Quote Link to comment https://forums.phpfreaks.com/topic/25533-problems-creating-full-text-index/#findComment-116818 Share on other sites More sharing options...
watts Posted October 31, 2006 Author Share Posted October 31, 2006 I started with the following:imgID - int(8)imgURL - varchar(100)imgThbURL - varchar(100)imgTitle - varchar(200)[color=purple]imgCaption - varchar(2000)[/color]and when I tried to index imgCaption alone or with other fields I got the error. I have spoken to my client and determined that I can safely set the imgCaption length to 400 and now the full text index is working. Thanks for the links about key lengths. I am however still interested in how you would do a full-text index if you did need the field to be much larger.Thanks Quote Link to comment https://forums.phpfreaks.com/topic/25533-problems-creating-full-text-index/#findComment-117520 Share on other sites More sharing options...
fenway Posted October 31, 2006 Share Posted October 31, 2006 VARCHAR(2000)? That's not even an option... Quote Link to comment https://forums.phpfreaks.com/topic/25533-problems-creating-full-text-index/#findComment-117550 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.