Jump to content
php.lv forumi

Full-text index uz MEDIUMTEXT


Sasa

Recommended Posts

Vadoties pēc dokumentācijas

Full-text indexes can be created only for CHARVARCHAR, or TEXT columns

 

Bet kā tad veikt meklēšanu vienīgais variants paliek lietot LIKE ?

 

Aizmirsu piebilsts ka tas ir MySQL's un tabula ir myISAM.

Edited by Sasa
Link to comment
Share on other sites

Man neļāva jo es gribēju vairākās kolonas ielikt full-text indeksā tur miksējās tipi bija Mediumtext un Varchar's. Mēģināju likt tikai uz vienu kolonu (Mediumtext) atļāva. Tad varbūt tādā gadījumā taisīt divus Full-text indexus vienu uz Mediumtext kolonu otru uz pārējām divām kolonām kuras ir varchar?

Edited by Sasa
Link to comment
Share on other sites

Kļūdu tagad nepateikšu. Bet tabula nebija tukša, aizpildītai tabulai mēģināju pielikt full-text indeksu.

nice1 vari atsūtīt datubāzes dumpu, palūrēšu salīdzināšu.

 

Errors šāds:

#1283 - Column 'texts' cannot be part of FULLTEXT index

 

Tabula šāda:

CREATE TABLE `menu2` (
  `menu_id` int(11) NOT NULL AUTO_INCREMENT,
  `ispub` tinyint(4) NOT NULL DEFAULT '0',
  `site_id` int(11) NOT NULL DEFAULT '0',
  `lang_id` int(11) NOT NULL DEFAULT '0',
  `pmenu_id` int(11) NOT NULL DEFAULT '0',
  `caption` varchar(255) DEFAULT '',
  `mdesc` varchar(255) NOT NULL DEFAULT '',
  `type` varchar(50) NOT NULL DEFAULT '',
  `so` int(11) NOT NULL DEFAULT '1',
  `texts` mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  `left_col_content` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `m_title` varchar(255) DEFAULT '',
  `m_desc` text NOT NULL,
  `m_keys` text NOT NULL,
  `rgt_col` varchar(50) NOT NULL DEFAULT '',
  `rgt_param` varchar(50) NOT NULL DEFAULT '',
  `show_jaun` smallint(1) NOT NULL DEFAULT '0',
  `jaun_c` int(11) NOT NULL DEFAULT '0',
  `ecom_cat` tinyint(4) NOT NULL DEFAULT '0',
  `source_from` varchar(255) NOT NULL,
  `fb_soc_buttons` tinyint(4) NOT NULL DEFAULT '0',
  `drlv_soc_buttons` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`menu_id`),
  KEY `so` (`so`),
  KEY `site_id` (`site_id`),
  KEY `lang_idi` (`lang_id`),
  KEY `pmenu_id` (`pmenu_id`),
  KEY `ispub` (`ispub`)
) ENGINE=MyISAM AUTO_INCREMENT=19141 DEFAULT CHARSET=utf8;

Index tiek veidots šādi:

ALTER TABLE `menu2` ADD FULLTEXT( `caption`, `texts`, `m_title`);
Edited by Sasa
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...