question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for full text search indexes

See original GitHub issue

Postgres, sqlite, and MySQL all support some form of full-text index. It would be useful to support generating schema for and querying based on these indexes.

This does not seem like a trivial feature, as the implementations are very different for index creation requirements (sqlite appears to be at the table-level, MySQL only supports it on MyISAM tables) and querying.

That said, this issue could at least be used to track interest for such a feature.

References:

Example index creation and querying:

  • PostgreSQL:
CREATE INDEX <INDEX NAME> ON <TABLE NAME> USING gin(to_tsvector(<COLUMN NAME>));

SELECT * FROM <TABLE NAME> WHERE <COLUMN NAME> @@ to_tsquery(<INPUT>);
  • MySQL:
CREATE FULLTEXT INDEX <INDEX NAME> ON <TABLE NAME>;

SELECT * FROM <TABLE NAME> WHERE MATCH <COLLUMN NAME> AGAINST <INPUT>;
  • sqlite:
CREATE VIRTUAL TABLE <TABLE> USING fts3(<COLUMN NAME> TEXT);

SELECT * FROM <TABLE NAME> WHERE <COLUMN NAME> MATCH <INPUT>;

Issue Analytics

  • State:open
  • Created 10 years ago
  • Reactions:46
  • Comments:37 (17 by maintainers)

github_iconTop GitHub Comments

27reactions
elhigucommented, Sep 29, 2017

removed flood +1 and status update request comments, please use thumbs for voting

EDIT: if there are no new messages in this feed, then there is nothing new to tell

19reactions
rapodacacommented, Sep 18, 2018

This issue was the top hit for many of the searches I did, but didn’t address my question. For those who also end up here for the same reason…

Postgres users can add a full text index to a tsvector column using the third argument to table.index. For example:

exports.up = (knex) => {
  return knex.schema.createTable('foo', (table) => {
    table.increments('id');
    table.specificType('fulltext', 'tsvector');

    table.index('fulltext', null, 'gin');
  );
);

Also see:

https://knexjs.org/#Schema-index

and

https://stackoverflow.com/questions/45871474/how-to-add-gin-index-using-knex-js

Read more comments on GitHub >

github_iconTop Results From Across the Web

12.10 Full-Text Search Functions
MySQL has support for full-text indexing and searching: ... Full-text searching is performed using MATCH() AGAINST() syntax. MATCH() takes a comma-separated list ...
Read more >
What is Full-Text Search and How Does it Work?
Full -text search refers to searching some text inside extensive text data stored electronically and returning results that contain some or all of...
Read more >
Full-Text Search - SQL Server
Full -text search is powered by the Full-Text Engine. The Full-Text Engine has two roles: indexing support and querying support. Full-Text ...
Read more >
Full-text search index - Cypher Manual
Full -text indexes are powered by the Apache Lucene indexing and search library, and can be used to index nodes and relationships by...
Read more >
Documentation: 15: Chapter 12. Full Text Search
Chapter 12. Full Text Search ... 12.3. Controlling Text Search ... 12.9. Preferred Index Types for Text Search · 12.10. psql Support ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found