handling multiple terms which may occur within different files in the same project #12834
-
|
I'm interested in using github code search to help find usages of APIs we're stabilizing in the rust standard library: example rust-lang/rust#88581 (comment) The problem I'm having right now though is I need to search for two different search terms which are likely to occur in different files. In the above example I handled it by searching for the first term, then individually searching within the projects that came back for the second term. I've not been able to figure out a way to concisely express this given the current API. The best way I can think of to solve this is to add a new scope option to the drop down next to the search bar after you've started a search. Instead of only "all repos" or each specific repo that matched the search terms, I'd like an option for "all repos from the current search" to narrow the scope you're searching based on a previous search from which you can execute a subsequent search. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
I think I see what you're saying - you want to do something like: "find all repositories that have ... in their Cargo.toml", then take that set and search for usages of a feature somewhere else in that set of repos. Unfortunately such a query is not possible to express right now. We're working on releasing an API though, which I think would be the answer for queries like this. You could make several queries, one to get repositories and another to search within them. The API would also allow you to exhaustively iterate through all of the results, which would probably be necessary for a search like that. |
Beta Was this translation helpful? Give feedback.

I think I see what you're saying - you want to do something like: "find all repositories that have ... in their Cargo.toml", then take that set and search for usages of a feature somewhere else in that set of repos.
Unfortunately such a query is not possible to express right now. We're working on releasing an API though, which I think would be the answer for queries like this. You could make several queries, one to get repositories and another to search within them. The API would also allow you to exhaustively iterate through all of the results, which would probably be necessary for a search like that.