From the course: Practical GitHub Code Search
Search qualifiers - GitHub Tutorial
From the course: Practical GitHub Code Search
Search qualifiers
- [Instructor] So you may be wondering what some of these other qualifiers are. I'm going to show you a big, huge list in a minute, and I want you not to worry about the size of the list because there are a lot of qualifiers that you can use. The super nice thing about search is that it gives you a lot of hints about what these qualifiers are, and also how you should fill them out. So you've already seen things like the owner qualifier, and perhaps something like the org. And you may have seen some other sections in the search and the search results that are going to help you with some of these things. Now, there's basically two types of qualifiers, these sort of generic main qualifiers, and there's also a series of flex qualifiers, which you'll use to narrow down a lot of the main qualifiers. So, for example, there is the type qualifier, which you can use with like org, pr, issues, discussions, et cetera. So that allows you to further refine your search. In addition, you can also use the is flex qualifier to let you look through whether an item is a fork, a poll request, an issue, et cetera, et cetera. There's also an in qualifier, and that gives you a simple way to search for content in a repository, and you can look for the title, comment, or the body in here as well. Now, the important thing here is to try some of these out. I know this is a big, huge list. It's not going to help you unless you check these things out. So let's look at some of the examples. So I'm going to come back here to the github.com page, and I'm going to try to search for something super simple. Notice that already when I click on the search box or I hit the Slash button, I get a lot of different options here. So I can search for my latest repositories or I can search for a specific owners. So it's going to give you some hints, but I'm just going to type in javascript here because it's going to be a pretty broad search. When it gives me my search results, you can see some of the main qualifiers here on the left-hand side. And you can even expand this to see more of them. So I can look for code that has the keyword javascript in it, repositories, issues, et cetera, et cetera. So if I look for repositories, I can further refine that search by using some of these options down here, looking for specific languages. Since I already type JavaScript in here, that's not going to make a lot of sense, although I could perhaps click on TypeScript, which is a subset of JavaScript, and that would let me know repos that had both of the items in there. But notice that there's also a section down here in the Advanced tab right here that lets me further refine my search by different things. So, for example, I can look for the number of stars of these repos, and it already gives me a lot of different values right here. So you could see that this repo has to have between zero and 100 stars. And I'm going to hit return here. And that's further going to refine my search by that amount. So you don't really have to memorize all of the different qualifiers, you just have to know that there are different kinds of qualifiers, mainly the traditional sort of qualifiers, and then the type, the is, and the in, which allows you to filter things further. And there is a lot of options. Most of them are right here. The other ones you can also find through this last option over here, which is the Advanced search. And Advanced search is going to be just a form that you can use to make it easier to find all of the different categories that you can search by. So here is pretty much all of the options that we already saw, with some examples of what you can type. And notice that they are broken down by the types of things that you want to search. And that's the thing about the qualifiers too. So sometimes, you'll try to find qualifiers and sub qualifiers, and it won't find what you're looking for, and that's because they really should be thought of as giving you the option of looking for certain types of things. So you can say, if you're looking for a repository, it would make sense to find the number of stars for the repository, with a certain amount of forks, of the size, and so on and so forth. But if I'm looking under issues, perhaps, the stars don't really matter all that much for issues. You want to find things like, for example, whether or not an issue is open or close, with a specific reason, with certain labels, et cetera, et cetera. So the qualifiers aren't as important to memorize because they are everywhere in the interface. And if you want to learn more about them, you can look at this Advanced search, and it's going to give you all the options that you need to know in order to search. I do want to remind you that if you're not seeing what I'm seeing when I'm searching, you want to make sure that you go to Feature preview on your account, and that you have this New Code Search and Code View turned on. Let's go ahead and just disable it for a second to see what this looks like. And then I'm going to go back here and then just type in... And notice that the list itself is a little bit different than what we've been seeing. So if you're not seeing the same thing I'm seeing, make sure that you do have that turn on. I'm just going to do a search for javascript again so you can see the difference between what we get. It's similar but not the same. And I'm missing some information here that would be on the right, which are some hints and lots of other goodies. Although it does give me this cheat sheet. And here's where the Advanced search would be, which is still pretty similar, but the two types of searches are different. And I'm also going to mention that sometimes because the new search engine is in beta form, sometimes the things that work with traditional search are not going to be quite implemented in the new search. So just keep that in mind as you continue to attempt to search for things.