Skip to main content

ElasticSearch or OpenSearch wrapper for CogStack deployments

Project description

Login and search

This project is responsible for logging in and performing a search for Elasticsearch or Opensearch.

Installation

This package is distributed through PyPI and can be installed using one of:

pip install cogstack-es[ES9]  # For Elasticsearch 9
pip install cogstack-es[ES8]  # For Elasticsearch 8
pip install cogstack-es[OS]  # For Opensearch

PS: After installation, the import still remains import cogstack even though the installed package is called cogstack-es.

Login details

You need to get your login details and host from your administrator. This is usually an API key. There is also a mechanism for reading hosts and credentials from environmental variables:

from cogstack import read_from_env, CogStack
hosts, api_key, (username, password) = read_from_env()
# subsequently use one of
cs = CogStack.with_api_key_auth(hosts=hosts, api_key=api_key)
#cs = CogStack.with_basic_auth(hosts=hosts, username=username, password=password)

The read_from_env method will read the data from the following environmental variables:

Environmetnal variable name Description Example value
COGSTACK_HOSTS The host addresses, comma separated http://localhost:9200,http://localhost:9201
COGSTACK_USERNAME The username for basic auth user123
COGSTACK_PASSWORD The password for basic auth sup3rsecur3-pw#946
COGSTACK_API_KEY_ID The API key ID for authentiaction l0cGtvtlw1lbsyClOm6w
COGSTACK_API_KEY The unencoded API key for authentiaction with the ID I01NJf4Z6yvXyXThh1676g
COGSTACK_API_KEY_ENCODED The encoded API key for authentiaction with just the API key ZZpwMtW3ky6Tw9KEtfavVzTP0JcrC7iLnVf7zXbqAh70A15VKJwHd5YX3J==

Note: If these fields are left blank then the user will be prompted to enter the details themselves.

If you are unsure about the above information please contact your CogStack system administrator.

How to build a Search query

A core component of cogstack is Elasticsearch which is a search engine built on top of Apache Lucene.

Lucene has a custom query syntax for querying its indexes (Lucene Query Syntax). This query syntax allows for features such as Keyword matching, Wildcard matching, Regular expression, Proximity matching, Range searches.

Full documentation for this syntax is available as part of Elasticsearch query string syntax.

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

cogstack_es-0.1.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

cogstack_es-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file cogstack_es-0.1.0.tar.gz.

File metadata

  • Download URL: cogstack_es-0.1.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cogstack_es-0.1.0.tar.gz
Algorithm Hash digest
SHA256 75f33fef01faa6ed965ea27ffc44f49cc1415f20ac939dd8dd7dffc98068873e
MD5 029390fd3c60229331515adab7094568
BLAKE2b-256 85265cbada9f45fee087479257dbfdc912eb0fd02df8908db40674ba84ab5b8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogstack_es-0.1.0.tar.gz:

Publisher: cogstack-es_release.yml on CogStack/cogstack-nlp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cogstack_es-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cogstack_es-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cogstack_es-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 050439c60f8857486e9e025df5d23ed419ef8c519f194994a3a81c2848b36993
MD5 ade0cf8e5cf33f564b73943168eabcea
BLAKE2b-256 96c56c9a06aff19fa463ea312a8e7b82fdc547950814ffb2b295825db58265f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogstack_es-0.1.0-py3-none-any.whl:

Publisher: cogstack-es_release.yml on CogStack/cogstack-nlp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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