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.2.0.tar.gz (20.1 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.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cogstack_es-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f669683e6fef3de718e77ef1b8ec4033fcd609a8896a20fcb517ade483db427a
MD5 5492ab2f09f8466bd61d6e18d95d189d
BLAKE2b-256 f08239423695c5ec9c249c8ab097eb3846428a22fdee7b66285b1607ebf798a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogstack_es-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: cogstack_es-0.2.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.12

File hashes

Hashes for cogstack_es-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c60a65668bc4d1a1ca693e3bcb6e1b812003d026ade82fd275c1ed7ca9a08436
MD5 90dc480fb7b657385c5916d6af25aef0
BLAKE2b-256 b25c6688918a1546d46329f727a2d2e287a3c55dee18d616c558ae6c20b649cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogstack_es-0.2.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