-
Notifications
You must be signed in to change notification settings - Fork 71
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
Is it possible to add a reindex api for git hooks? #113
Comments
Heya - there is no reindexing api atm, but could be an interesting addition to include with #101. Currently, reindexing happens once per hour. What is your use case? Is it often you want to search on new commits / branches as soon as they are pushed to the remote? Also, what code host are you using? Assuming it has webhook support, I wonder if #57 would be preferred for this use case instead of using git hooks. |
Yes, what I mentioned is similar to #57, my fault that didn't notice that. I am in a special condition that I use gitlab to host not code but some docs which need to be version controlled and also need to be searched. Since there is a need to search in real time so I care about real time reindexing. I think an api for reindex is not difficult to implement after a quick browse to source code, but my concern is whether there is a performance issue in the index engine with frequent reindexing due to frequent commits. |
Are you using Sourcebot on your local machine? If so, one work-around that you could try is to use local indexing with the watch-mode enabled. Any changes made within the specified {
"$schema": "./schemas/v2/index.json",
"repos": [
{
"type": "local",
"path": "/path/to/my/repo",
"watch": true
}
]
} If not local, then yea we will either need a webhook support or a REST api. In terms of performance issues, I think that would depend on the frequency at which a re-indexing occurs and the size of the repo that is being indexed.. so best bet will be to for us to benchmark, see where the limits are, and go from there. |
Thanks very much for the help. I am going on a test on if there is a performance issue. |
Sounds good - let me know if you run into any issues for it. Going to close this issue for now, but please feel free to re-open. |
Notice that the index could be only reindexed while restart. Could it be possible to add a reindex api for git hooks to reindex when new commit or new branch is added?
The text was updated successfully, but these errors were encountered: