Skip to main content

Sifts – Simple Full Text Search

Sifts is a simple Python full text search engine library with an SQLite or PostgreSQL backend.

It is meant to be used with Python libraries that need full-text search support, but where deploying something like ElasticSearch is overkill.

It supports both SQLite FTS5 and PostgreSQL FTS as backends.

Installation

pip install sifts

Usage

import sifts

# by default, creates a new SQLite database in the working directory
collection = sifts.Collection(name="my_collection")

# Add docs to the index. Can also update and delete.
collection.add(
    documents=["Lorem ipsum dolor", "sit amet"],
    metadatas=[{"foo": "bar"}, {"foo": "baz"}], # otpional, can filter on these
    ids=["doc1", "doc2"], # unique for each doc. Uses UUIDs if omitted
)

results = collection.query(
    "Lorem",
    # limit=2,  # optionally limit the number of results
    # where={"foo": "bar"},  # optional filter
    # order_by="foo",  # sort by metadata key (rather than rank)
)

The API is inspired by chroma.

Search Syntax

Sifts supports the following search syntax:

  • Search for individual words
  • Search for multiple words (will match documents where all words are present)
  • and operator
  • or operator
  • * wildcard (in SQLite, supported anywhere in the search term, in PostgreSQL only at the end of the search term)

The search syntax is the same regardless of backend.

Metadata

Release files for sifts 0.8.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sifts 0.8.3
File Size Uploaded
sifts-0.8.3.tar.gz 13.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sifts 0.8.3
File Interpreter ABI Platform
sifts-0.8.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / sifts-0.8.3.tar.gz

Download URL sifts-0.8.3.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
600d2a15b3a1b4c52739f5b0bf7e4e9906b54414f34bfb4ea0ed4cd1e27564dc
BLAKE2b-256 checksum
How to use checksums
1a96ced7505a86c27d180319310348bcbfcbc20a944f56e0dbad7d31a497e598
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / sifts-0.8.3-py3-none-any.whl

Download URL sifts-0.8.3-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad4b3c4fcdd1216de969b3351f2e0ea11be317efb633e064a78127ccc6646b87
BLAKE2b-256 checksum
How to use checksums
a8f7563a25f43e94b44d4a8a49af9665f139c737ac86fa2679e2817ad8fa2eef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

This release

0.8.3 This release

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page