Jump to content

Archived

This topic is now archived and is closed to further replies.

watts

Problems creating full text index

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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=4541

http://forums.mysql.com/read.php?25,68461,68461

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Post your table structure.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
VARCHAR(2000)? That's not even an option...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.