Framework-independent package for converting query strings to Elasticsearch queries.
$ pip install snovault-search
from snosearch.defaults import DEFAULT_ITEM_TYPES
from snosearch.fields import BasicSearchResponseField
from snosearch.parsers import ParamsParser
from snosearch.responses import FieldedResponse
def basic_search_view(request):
fr = FieldedResponse(
_meta={
'params_parser': ParamsParser(request)
},
response_fields=[
BasicSearchResponseField(
default_item_types=DEFAULT_ITEM_TYPES
)
]
)
return fr.render()
$ pip install -e .[test]
$ pytest
Bump version in setup.cfg
, then build and upload:
$ python -m build
$ twine upload dist/*