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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.