Giter Club home page Giter Club logo

Comments (7)

bnewbold avatar bnewbold commented on July 25, 2024 1

Also, if you are planning to do an integration, we will probably make the scholar ("full-text") content available through https://search.fatcat.wiki as a separate index. This endpoint exposes the raw elasticsearch API (behind a proxy, es-public-proxy), which might be easier to develop with. In both cases we aren't yet offering any long-term API stability guarantees, as this is still an "alpha" service.

from fatcat-scholar.

bnewbold avatar bnewbold commented on July 25, 2024

Indeed! Thanks for reporting.

I don't have any intention of adding JSONP support. The fatcat API itself (api.fatcat.wiki) should work with CORS, but of course doesn't include the full search stuff.

Please note that that we will be changing the domain at some point, probably to scholar.archive.org, and the scholar-qa domain will redirect or be a staging area, which could break CORS again.

from fatcat-scholar.

waldenn avatar waldenn commented on July 25, 2024

Ok, excellent. I will plan on using the raw Elasticsearch API. Thanks for all the hard work!

from fatcat-scholar.

bnewbold avatar bnewbold commented on July 25, 2024

I think the CORS issue is fixed now, for a minimal set of headers, GET requests, and any Origin. At least, testing naively with:

curl -I -X OPTIONS \
  -H "Origin: http://EXAMPLE.COM" \
  -H 'Access-Control-Request-Method: GET' \
  https://scholar-qa.archive.org/search

Seems to work as expected, I didn't test with a real cross-domain browser request.

I also catch the case of an API call with no q parameter and return a 400 error for that, though this isn't expressed correctly in the OpenAPI spec. Using FastAPI for both an API and web serving is sort of weird.

from fatcat-scholar.

waldenn avatar waldenn commented on July 25, 2024

Great! I tweeted about the integration here. Such a cool project!

Nitpick issue I saw: The returned results also highlights ("_highlights") the search-language. I think this is not really needed / useful, but may just be a technical issue on the backend.

from fatcat-scholar.

bnewbold avatar bnewbold commented on July 25, 2024

Yes, the highlights are included (undocumented) because I am basically passing back exactly the query results that would be used in the web interface.

That could be controlled for API calls via a query parameter though. If you are interested in that, could you create a new issue?

from fatcat-scholar.

waldenn avatar waldenn commented on July 25, 2024

Done: #54

from fatcat-scholar.

Related Issues (20)

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.