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

Improve search - Make less API calls #5549

Open
bradystroud opened this issue Jun 29, 2021 · 4 comments
Open

Improve search - Make less API calls #5549

bradystroud opened this issue Jun 29, 2021 · 4 comments
Labels
area: search exp: intermediate type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@bradystroud
Copy link
Contributor

bradystroud commented Jun 29, 2021

Is your feature request related to a problem? Please describe.
The search functionality does not work for our content. Firstly it is very slow to use, and secondly after 2 searches it fails becuase it hits the GitHub API limit. This could be fixed by changing the code to use the GitHub API search endpoint.

see https://answers.netlify.com/t/cms-search-hitting-github-api-limit/39124

Describe the solution you'd like
The search code could be optimised so it doesn't make a request for every item in the collection.
This should be possible with the GitHub search endpoint - https://docs.github.com/en/rest/reference/search#search-code

Describe alternatives you've considered
We have turned off search to avoid the problem, by using the search config option.
https://www.netlifycms.org/docs/configuration-options/#search

Additional context
#5501
#5501 (comment)

@bradystroud bradystroud added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jun 29, 2021
@bradystroud bradystroud changed the title Improved search - Make less API calls Improve search - Make less API calls Jun 29, 2021
@kg-kartik
Copy link

@erezrokah Can I try fixing this issue?

@erezrokah
Copy link
Contributor

erezrokah commented Aug 9, 2021

Sure thing @kg-kartik, thanks. Please consider that we would like to do this in a backwards compatible way (minimal changes to search behavior) and that it should work in a similar way for all backends.
The reason the CMS needs to read the content of each file is that it parses the content (e.g. markdown) and searches in each field.

@jdromero88
Copy link

Is there any update on this?

@martinjagodic
Copy link
Member

@jdromero88 the best way to move this forward is to open a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: search exp: intermediate type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

6 participants
@kg-kartik @erezrokah @bradystroud @martinjagodic @jdromero88 and others