Git Product home page Git Product logo

vespa-python-query-client's Introduction

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})

vespa-python-query-client's People

Contributors

shastick avatar a-pagano avatar killerwhile avatar

Stargazers

Yashasvi Mantha avatar Joe avatar Ícaro Jerry avatar Caio Jordão Carvalho avatar xuin avatar Mikal avatar  avatar Christopher Chiche avatar  avatar

Watchers

 avatar Jean Rossier avatar James Cloos avatar Christopher Chiche avatar  avatar  avatar  avatar  avatar

Forkers

joskid

vespa-python-query-client's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.