Skip to main content

A Python DSL for Elasticsearch queries

Project description

pyelasticdsl

A minimal, Pythonic DSL for building Elasticsearch queries with method chaining.
Supports common query types such as MatchQuery, TermQuery, QueryStringQuery, RegexpQuery, ExistsQuery, PercolatorQuery, and more.

✅ Compatible with Python 3.12+


📦 Installation

pip install pyelasticdsl

🧱 Basic Usage

from pyelasticdsl.query import QueryStringQuery

query = (
    QueryStringQuery("user:kimchy AND message:search")
    .DefaultField("content")
    .DefaultOperator("AND")
    .AnalyzeWildcard(True)
    .Boost(2.0)
)

print(query.to_dict())

Produces:

{
  "query_string": {
    "query": "user:kimchy AND message:search",
    "default_field": "content",
    "default_operator": "AND",
    "analyze_wildcard": true,
    "boost": 2.0
  }
}

🧪 Supported Queries

  • MatchQuery
  • TermQuery
  • QueryStringQuery
  • RegexpQuery
  • ExistsQuery
  • PercolatorQuery
  • ...more coming soon

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

pyelasticdsl-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

pyelasticdsl-0.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyelasticdsl-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for pyelasticdsl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abe6a7057d3c4f230214b7f1a981504f51255d4cc39057937fce8a1ca082685a
MD5 656c6bf915b57e6627acbbf6dcdf78c3
BLAKE2b-256 9fbe98cee855a0152c8f6e4a03bd4a745b2e3badaf56ec0511739405c2b0b791

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyelasticdsl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for pyelasticdsl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52928e12d4a7c07f1ac0f4c99a375f41861f0baaa331d746ae7a7c6560ba1b35
MD5 36a1ad612d58a93a9eae39baf5b40a57
BLAKE2b-256 84b5dd4b19f827e618f20dc97748d458014d39dfb599a94b383873c3fde7c8a2

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