Skip to main content

RedisSearch Python Client

Project description

license PyPI version CircleCI GitHub issues Codecov

RediSearch Python Client

Mailing List Gitter

This is a python search engine library that utilizes the RediSearch Redis Module API.

It is the "official" client of redisearch, and should be regarded as its canonical client implementation.

Features

RediSearch is an open-source (AGPL), high performance search engine implemented as a Redis Module. It uses custom data types to allow fast, stable and feature rich full-text search inside redis.

This client is a wrapper around the RediSearch API protocol, that allows you to utilize its features easily.

RediSearch's features include:

  • Full-Text indexing of multiple fields in documents.
  • Incremental indexing without performance loss.
  • Document ranking (provided manually by the user at index time) and field weights.
  • Auto-complete suggestions (with fuzzy prefix suggestions)
  • Exact Phrase Search
  • Stemming based query expansion in many languages (using Snowball).
  • Limiting searches to specific document fields (up to 8 fields supported).
  • Numeric filters and ranges.
  • Automatically index existing HASH keys as documents.

For more details, visit http://redisearch.io

Example: Using the Python Client

from redisearch import Client, TextField

# Creating a client with a given index name
client = Client('myIndex')

# Creating the index definition and schema
client.create_index((TextField('title', weight=5.0), TextField('body')))

# Indexing a document
client.add_document('doc1', title = 'RediSearch', body = 'Redisearch impements a search engine on top of redis')

# Simple search
res = client.search("search engine")

# Searching with snippets
res = client.search("search engine", snippet_sizes = {'body': 50})

# Searching with complext parameters:
q = Query("search engine").verbatim().no_content().with_scores().paging(0,5)
res = client.search(q)


# the result has the total number of results, and a list of documents
print res.total # "1"
print res.docs[0].title 

Installing

  1. Install Redis 4.0 or above

  2. Install RediSearch

  3. Install the python client

$ pip install redisearch

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redisearch-0.9.0.tar.gz (2.1 MB view details)

Uploaded Source

File details

Details for the file redisearch-0.9.0.tar.gz.

File metadata

  • Download URL: redisearch-0.9.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.17

File hashes

Hashes for redisearch-0.9.0.tar.gz
Algorithm Hash digest
SHA256 380407aa41666f60a698ae7cc0de6efc3bd0b132a949ab7c17d491abd890bd51
MD5 db5b16a12f66f0553ff302bfe0eba2e0
BLAKE2b-256 b03ed71a9770fc397b5ac24d636ae46bbf03899bc82a5259e56b9e2c0c452b00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page