Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FULLTEXT indexes throw a parse error on sync() #2979

Closed
nullivex opened this issue Jan 21, 2015 · 5 comments
Closed

FULLTEXT indexes throw a parse error on sync() #2979

nullivex opened this issue Jan 21, 2015 · 5 comments
Assignees

Comments

@nullivex
Copy link
Contributor

Hi,

I know that the indexes code is relatively new so this bug probably hasnt affected most people yet.

However I have a model with this in the field definition:

{
        name: 'ft_search_index',
        method: 'FULLTEXT',
        fields: ['title','altTitles']
      }

When I try to do a sync() I get a parse error.

I have to get my lab set back up to produce the parse error. However this should be easily reproducible.

EDIT here is the error.

{ [SequelizeDatabaseError: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FULLTEXT ON `Shows` (`title`, `altTitles`)' at line 1]
  name: 'SequelizeDatabaseError',
  message: 'ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'FULLTEXT ON `Shows` (`title`, `altTitles`)\' at line 1',
  parent:
   { [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FULLTEXT ON `Shows` (`title`, `altTitles`)' at line 1]
     code: 'ER_PARSE_ERROR',
     errno: 1064,
     sqlState: '42000',
     index: 0,
     sql: 'CREATE INDEX `ft_search_index` USING FULLTEXT ON `Shows` (`title`, `altTitles`)' },
  original:
   { [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FULLTEXT ON `Shows` (`title`, `altTitles`)' at line 1]
     code: 'ER_PARSE_ERROR',
     errno: 1064,
     sqlState: '42000',
     index: 0,
     sql: 'CREATE INDEX `ft_search_index` USING FULLTEXT ON `Shows` (`title`, `altTitles`)' },
  sql: 'CREATE INDEX `ft_search_index` USING FULLTEXT ON `Shows` (`title`, `altTitles`)' }

Version

e132 drama # npm ls | grep seq
├─┬ sequelize@2.0.0-rc8
@nullivex nullivex changed the title Full Text indexes create parse error on sync FULLTEXT indexes throw a parse error on sync() Jan 21, 2015
@nullivex
Copy link
Contributor Author

As an added note.

I was able to work around this by commenting out the index, syncing then manually adding the index, then uncommenting the index definition.

@janmeier
Copy link
Member

You should use type: 'FULLTEXT' instead of method

http://sequelize.readthedocs.org/en/latest/api/sequelize/#definemodelname-attributes-options-model

@ddeshmane
Copy link

I don't see any documentation on how to configure MySQl DB and Sequelize to implemented Full Text Search. My MySQL version is 5.5.14 and Sequelize version is 3.23.4.
Please guide me to links/code-snippets where I can read on how to configure DB and Sequelize JS for FTS and how to perform FTS Query ?

I am really stuck on this.

@felixfbecker
Copy link
Contributor

@ddeshmane you probably will get more help on StackOverflow

@ddeshmane
Copy link

ddeshmane commented Aug 25, 2016

@felixfbecker
I have already posted a question on stackoverflow but got not response.
Stackoverfow Question: http://stackoverflow.com/questions/39123631/mysql-fulltext-search-with-sequelize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants