Skip to content

Sqooba/vespa-python-query-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Python3 CLI to Vespa.ai's search interface

Vespa.ai seems to miss a simple command line interface to issue search requests to the http rest api.

At this point this simply takes a YQL or simple query, sends it off, pretty printing the result, while supporting the addition of GET parameters.

Dependencies

  • absl - flags parsing - pip install absl-py
  • requests - http client - pip install requests

Sample usage:

# Simple query
$ ./vespa-search.py --query bob

# With parameters
$ ./vespa-search.py --query bob --param hitcountestimate=True,tracelevel=2

# Or a complete YQL query
$ ./vespa-search.py --yql "select * from sources * where default contains 'bob'"

Additional functionalities will be added progressively. Currently only using python3, but should be ok with Python2 as well.

Vespa YQL/Query Cheat sheet

Partial tag list matches

If tags is an array<string> field, documents can be retrieved based on the tags they contains using weightedSet(<field>,{'<findMe1>':<weight>, ...}). The weights will be used to rank the document, and documents do not need to contain all tags to be returned:

select * from sources * where weightedSet(tags, {'juicy': 50, 'boring':1})

About

A simple CLI for accessing Vespa.ai's http search api.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages