Search Functionality
Spice provides advanced search capabilities that go beyond standard SQL queries, offering both traditional SQL search patterns, semantic (vector-based) search, and full text search functionality.
Vector Search
Vector-based search requires configured data sources (connectors or accelerators) in addition to embeddings. These embeddings convert data to numerical representations that can be used by machine learning models, facilitating similarity comparisons for more advanced search capabilities.
Configuring embeddings is required for vector-based search. For detailed instructions on setting up embeddings, refer to Configured Embeddings.
For performing vector-based search, see Vector-Based Search.
Full Text Search
Full text search provides keyword based retrieval for a dataset. Search specific indexes are required to be added to the underlying columns of importance. This provides an efficient lookup and counting of words within rows and the table more broadly.
For performing full text search, see Full text Search.
Hybrid Search
Spice supports hybrid search utilizing full-text search and vector search functionality.
The v1/search
endpoint will automatically use hybrid search when configured with both full-text & vector search.
SQL Search
SQL-based search requires the integration of data connectors or data accelerators. For more information on setting up data connectors and accelerators, see Data Connectors and Data Accelerators.
Spice supports basic search patterns directly through SQL, leveraging its SQL query features. For example, you can perform a text search within a table using SQL's LIKE
clause:
SELECT id, text_column
FROM my_table
WHERE
LOWER(text_column) LIKE '%search_term%'
AND
date_published > '2021-01-01'
SQL UDTFs
Similar to the above mentioned vector search and full text search, Spice supports SQL equivalent user-defined table functions (UDTF).
To perform a vector search
SELECT id, extra_column, score
FROM vector_search(my_table, 'search query')
WHERE date_published > '2021-01-01'
ORDER BY score desc
LIMIT 5
For an entire specification of the vector_search
UDTF, see Vector-Based Search.
Similarly, for full text search use the text_search
UDTF
SELECT id, extra_column, score
FROM text_search(my_table, 'search terms')
WHERE date_published > '2021-01-01'
ORDER BY score desc
LIMIT 5
For an entire specification of the text_search
UDTF, see Full text Search.
📄️ Vector Search
Learn how Spice can perform searches using vector-based methods.
📄️ Full-text Search
Learn how Spice can perform full text search