Coder Social home page Coder Social logo

Comments (5)

frodelu avatar frodelu commented on June 21, 2024

@tracy55 Thank you for filing this.

When querying the API, you cannot use the same GET parameters as you see in the frontend or the frontend query language. You need to use the Vespa YQL query language through the Vespa Search API.

Some examples are listed in the CORD-19 documentation under "Example API queries".

I'll update this issue with your exact query shortly.

from cord-19.

frodelu avatar frodelu commented on June 21, 2024

@tracy55 Your specific FE query would translate to something like this:
https://api.cord19.vespa.ai/search/?query=covid-19&summary=short&ranking=freshness&yql=select%20*%20from%20sources%20*%20where%20userQuery()%20and%20timestamp%20%3E%201577836800%20and%20journal%20contains%20%22the%20lancet%22%3b

Or - if using a POST request with the JSON (a bit easier to work with) it would look like this:

{
  'yql': 'select * from sources * where userQuery() and timestamp > 1577836800 and journal contains "the lancet";',
  'summary': 'short',
  'query': 'covid-19',
  'ranking': 'freshness'
}

Hope this helps.

from cord-19.

tracy55 avatar tracy55 commented on June 21, 2024

Thank you @frodelu this is very helpful, much appreciated.

from cord-19.

tracy55 avatar tracy55 commented on June 21, 2024

@frodelu I'm noticing some latency, what is the expected sla for this sample call https://api.cord19.vespa.ai/search/?query=covid-19&summary=short&hits=20&ranking=freshness&yql=select+*+from+sources+*+where+userQuery%28%29+and+timestamp+%3E+1577836800%3B

from cord-19.

bratseth avatar bratseth commented on June 21, 2024

About 10-15 ms. Where are you calling us from, and do you use persistent connections?

from cord-19.

Related Issues (7)

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.