Skip to content

MySQL full text seach #186

@hugofialho

Description

@hugofialho

Suggestion

Suport full text search in mysql using match against

Examples

To query data i thought this:

{"where": {"fts": { "match": ["column1", "column2"], "against":"filter" }}}

I studied the code and implement this inside de method 'SQLConnector.prototype._buildWhere'

if (key === 'fts') {
  console.log("Full text search!!!");
  const matchObj = where[key]["match"];
  const match = Array.isArray(matchObj) 
    ? matchObj.map(c => self.columnEscaped(model, c)).join(",")
    : self.columnEscaped(model, matchObj);
  stmt.merge(`MATCH(${match}) AGAINST('${where[key]["against"]}')`);
  whereStmts.push(stmt);
  continue;
}

Acceptance criteria

There is any suggestion to enhance the solution?
This idea is in the scope of this project? If yes, how can i do a pull request?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions