Jump to content

Problems creating full text index


watts

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.
Link to comment
https://forums.phpfreaks.com/topic/25533-problems-creating-full-text-index/
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?
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

Archived

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

×
×
  • Create New...

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.