Skip to main content

Algolia Query Builder

Project description

A library to help build queries for searching Algolia.

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

PyPI version

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.7.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.7-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: algoliaqb-0.0.7.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.7.tar.gz
Algorithm Hash digest
SHA256 cb8ccf1313eea93b7fade141ccd0072046e67572c9a2aa2a0ba3515d6d87d7a5
MD5 cdcfd3e426f65c90269ed884df4d95d2
BLAKE2b-256 e21d5401d5ecbfbcc241b1e2232332d2adbc264663758a50e073d092b1cf557b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: algoliaqb-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4d1b482d1140200f6d50ddf2252c7d04e3208cf3ac5b39a96adb0040145185f6
MD5 775dbc647f22fa52fa99f540af36e08a
BLAKE2b-256 dd6e8b6b10ff276e0347fd2dbda07ddb41eb62234d9da01229a76c268be5972e

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