Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 932 Bytes

how-to-use-forward-slash-in-sphinxsearch.md

File metadata and controls

24 lines (15 loc) · 932 Bytes

How to use forward slash in SphinxSearch?

// plain

SphinxSearch uses forward slash (/) as a special character to separate search terms. It is used to search for exact phrases, and to group search terms together.

Example

SELECT * FROM documents WHERE MATCH('"hello world"/2');

This query will search for documents containing the exact phrase "hello world" with a maximum of two words between them.

Code explanation

  • SELECT * FROM documents: This part of the code selects all columns from the documents table.
  • WHERE MATCH('"hello world"/2'): This part of the code searches for documents containing the exact phrase "hello world" with a maximum of two words between them.

Helpful links

onelinerhub: How to use forward slash in SphinxSearch?