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 | MYSQL | failed with status code 500. Error: ER_PARSE_ERROR: You have an error in your SQL syntax; #475

Open
MwSpaceLLC opened this issue Dec 5, 2022 · 1 comment
Labels

Comments

@MwSpaceLLC
Copy link

Describe the bug

Hi there,

Today we try to fulltextsearch with mysql, after install system, and configure as follow:
image

Our application model:
image

Our request crud (get):
image

Server response:
image

System as installed with clear installation and clear mode, repo & crud generation.

Logs

No response

Additional information

Install loopback, generate model, add fulltextindex, add mysql datasource, query with match fulltext query

Reproduction

Sorry, dataset has private, we can reproduce error with dataset demo.

@akshatdubeysf
Copy link
Contributor

akshatdubeysf commented Dec 10, 2022

@MwSpaceLLC It seems like there could be a couple of reasons that result in the error that you are facing -

  • The LB4 cli seems to add an old version loopback-connector-mysql while creating a datasource, if that is the same in your case, you need to manually update the loopback-connector-mysql version to atleast 6.1.0 to use the match operator.

  • The index is not being migrated through the column level configurations as mentioned in this issue, can you try this instead in the model decorator -

@model({
  settings: {
    strict: true,
    allowExtendedOperators: true,
    mysql: {
      table: '<your table name>',
    },
    indexes: {
      some_name_index: {
        kind: 'FULLTEXT',
        columns: '<your column name>',
      },
    },
  },
})
export class YourModel extends Entity {

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

No branches or pull requests

2 participants