Skip to main content

Algolia Query Builder

Reason this release was yanked:

The badge in the product description isn't working right.

Project description

A library to help build queries for searching Algolia.

This package is meant to be used with the algoliasearch library.

Algolia Query Builder

Problem:

An app I have been working on has a few points of code duplication and increased complexity. This package is a way for me to fix those issues and increase readability.

Installation

pip install algoliaqb

Example:

from algoliasearch.search_client import SearchClient
from algoliaqb import AlgoliaQueryBuilder
from flask import request


aqb = AlgoliaQueryBuilder(
    search_param="search",
    filter_map={
        "group_id": "tenant_id",
        "is_reported": "is_reported"
    }
)

# Extract the search query from our flask apps request.args var.
search_query = aqb.get_search_query(request.args)
# Get the filter query from our request args.
filter_query = aqb.get_filter_query(request.args)

# Now that we have the filter string, we just pass it into the search function.

search_client = SearchClient()
index = search_client.init_index("contacts")
results = index.search(search_query, {"filters": filter_query})

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

algoliaqb-0.0.4.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algoliaqb-0.0.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file algoliaqb-0.0.4.tar.gz.

File metadata

  • Download URL: algoliaqb-0.0.4.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for algoliaqb-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e4f657297738d7d573546c4bf9ed23b7df24f094e893092aea5cc0a18d4f47f7
MD5 1265d619edbe863bf556e49c9bbd8705
BLAKE2b-256 f2ee2fee6058be480bb7df7b33fae34455c52c996ceaf93ff699797c1046b365

See more details on using hashes here.

File details

Details for the file algoliaqb-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: algoliaqb-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for algoliaqb-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ca39187256173b227a3bf477b5a3a45599a856b3915c91686da228d7b30f3ea6
MD5 79eff4346deae5ee2405ff10cf80eb43
BLAKE2b-256 8fc84dc5f5a9d5cce1b3e1fad4f25641a0e3378889cdcf7699213f1141f25630

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