Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.
/ gambit Public archive

Micro library for performing multi-search/ multi-percolate queries on Elasticsearch using elasticseach-py

Notifications You must be signed in to change notification settings

avichalp/gambit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gambit

A micro library for performing multi-search/multi-percolate queries on Elasticsearch using elasticseach-py

Build Status

Installation

pip install gambit

API

Let queries be expressed in the form of python dictionaries.

query1 = {...}
query2 = {...}
query3 = {...}

document1 = {...}
Msearch

To perform a multisearch use Msearch class

from elasticsearch import Elasticsearch
from gambit import Msearch
search = Msearch(Elasticsearch(), index='some-index', doc-type='some-doc-type')

Use add method of Msearch class to build a query.

search.add(query1)
search.add(query2)
search.add(query3)

Use execute method of Msearch class to fire the aggregated query.

list_of_results = search.execute()
percolate_and_get

Use percolate_and_get function to percolate and fetch all matching documents.

matching_docs = precolate_and_get(Elasticsearch(), document1,
                                    index='some-index', doc-type='some-doc-type')

Docs

Look at full documentation here

About

Micro library for performing multi-search/ multi-percolate queries on Elasticsearch using elasticseach-py

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages