Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

553
Vistas
Fulltext search using Sequelize (Postgres)

So I've been working with sequelize for a while now, and after juggling with elasticsearch, I decided to make use of postgres's support for fts.

It looks like just at the start of this year sequelize added support for TSVector which is necessary for FTS implementation. Although I just can't find any documentation whatsover anywhere.

The pull request

All help is appreciated!

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

If you look at changes for the PR you will see new operator Op.match and the new data type DateTypes.TSVECTOR. You can now define a field like this in a model:

...
textField: {
   type: DataTypes.TSVECTOR
}
...

And you simply can use it like this in where option:

textField: {
  [Op.match]: Sequelize.fn('to_tsquery', 'fat & rat') // match text search for strings 'fat' and 'rat' (PG only)
}

See this readme

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda