Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parmas 'search' is not correct?? #71

Closed
bigrain220 opened this issue Apr 29, 2022 · 2 comments
Closed

parmas 'search' is not correct?? #71

bigrain220 opened this issue Apr 29, 2022 · 2 comments

Comments

@bigrain220
Copy link

image

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!

@MattIPv4 MattIPv4 transferred this issue from cdnjs/cdnjs Apr 29, 2022
@MattIPv4
Copy link
Member

👋 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.

@MattIPv4
Copy link
Member

Closing as intended behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants