There is 1 comment.
 
 
Cristal / cid:jira-generated-image-avatar-1c78f274-c1f6-4951-97b3-1ce86c805504 CRISTAL-495 Open

Add support for links suggestion for the github backend

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-c855d7ea-fae3-4423-8d5c-5bb9b074ff9f Pierre Jeanjean on 11/Mar/25 13:03
 

We won't be able to only use GitHub's code search endpoint for this: the endpoint has still not been updated to use a query syntax allowing to match paths with regex and glob patterns.
Also, a limitation of the search API is that forks are not indexed if they have less stars than the original repository (I haven't tested this behavior extensively but it is mentioned in the documentation).

I think the best approach we can use at this point is to get a list of all nodes through the git tree endpoint and match the suggest query ourselves.

This is not ideal, however, because we won't be able to match the page title with this method.
To match a page title, we would need to use the code search endpoint with the following query: q=repo%3A<username>%2F<reponame>%20fork%3Atrue%20%22name%22%3A%22<query>
But we would still have the same limitations: no regex (so, only exact match from the start of the query) and no support for forks with less stars than the original repo...