Closed bigrain220 closed 2 years ago
👋 You can take a look at the code doing the API search here, it is just making a call to Algolia: https://github.com/cdnjs/api-server/blob/master/routes/libraries.js
Similarly, you can compare the code doing the search in the website here, it is also just making a call to Algolia: https://github.com/cdnjs/static-website/blob/master/components/search/inline_search.vue
The key difference is that the API uses browseObjects
to allow fetching of every result programmatically from Algolia, whereas the client uses a pure search which is much more restricted in terms of the number of results that are returned. I suspect that doing a pure search introduces other ranking factors that browserObjects
does not consider.
Closing as intended behaviour.
i want to get the same data as the picture show from you website, so i send address:''https://api.cdnjs.com/libraries?search=jquery&limit=5". But it doesnot work. The data returned is not correct. what should i do? help me please!