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.

full-text search: add a section about how search compares to contains

See original GitHub issue

Under the hood contains uses LIKE, search uses the full-text search capabilities of the database.

https://stackoverflow.com/questions/224714/what-is-full-text-search-vs-like

Full-Text Search also does stemming, given “Quick brown fox”

  • contains: "foxes" will return nothing
  • search: "foxes" will return the result

Also if you add indexes, full text search can be quite a bit faster for querying.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
maxmorlockecommented, Nov 19, 2021

I would suggest that the documentation talk about how to handle multiple word searches (e.g. Los Angeles needs to be broken down into Los | Angeles or Los & Angeles). The existing documentation somewhat hints at the need for this, but doesn’t explicitly state it. This is a common trap for people doing full text search for the first time.

We should probably also talk about prefix matching, etc. such as adding :* to each token if someone wants to match on Los An for Los Angeles or similar.

Some reference material for common pain points: https://stackoverflow.com/questions/2513501/postgresql-full-text-search-how-to-search-partial-words https://czep.net/17/full-text-search.html

1reaction
matthewmuellercommented, Oct 27, 2021

You’d need to split “Quick brown foxes” into words. There’s an example in https://github.com/prisma/docs/issues/2233

Read more comments on GitHub >

github_iconTop Results From Across the Web

Full-Text Search - SQL Server - Microsoft Learn
A full-text query returns any documents that contain at least one match (also known as a hit). A match occurs when a target...
Read more >
Hands on Full-Text Search in SQL Server
Adding data to a Full-Text index is referred to as population. In contrast to normal indexes, these populations are not part of a...
Read more >
MySQL Full text search - w3resource
MySQL Full text search: Full-Text Search in MySQL server lets users run full-text queries against character-based data in MySQL tables.
Read more >
12.10 Full-Text Search Functions - MySQL :: Developer Zone
Full-text searching is performed using MATCH() AGAINST() syntax. MATCH() takes a comma-separated list that names the columns to be searched. AGAINST takes a ......
Read more >
SQL Server Full Text Search Language Features - Simple Talk
SQL Full-text Search (SQL FTS) is an optional component of SQL Server 7 and later, which allows fast and efficient querying when you...
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