Example1:
C:\Users\richard.bulger>faker search beer -v
Sorry, we couldn't find a match 😢
C:\Users\richard.bulger>faker search yeast -v
Faker
└── yeast=> 5526 - Brettanomyces lambicus
Faker
├── as_you_like_it=> I like this place and willingly could waste my time in it.
└── as_you_like_it_quote=> Can one desire too much of a good thing?.
Note that the first result for beer returns nothing. But the second for yeast, which is a method of beer does. (Also note that the namespace name isn't shown in the result tree, which I've raised in #1565 )
Also, in the second result, you can see it also returns irrelevant results from the Shakespeare namespace. Not sure why.
Example2:
C:\Users\richard.bulger>faker search simpsons -v
Faker
└── i_groups=> Two Two
Doesn't return any simpons namespace stuff, but returns a Kpop one...
@akabiru ☝️
Example 2 is matching "simpsons" as the kpop method is split in 2 before comparison, "i" and "group". As such, it will match anything with an "i" in the search string:
C:\Users\richard.bulger>faker search xxxxxxxxxxxxxxxxxxxx -v
Sorry, we couldn't find a match 😢
C:\Users\richard.bulger>faker search xxxxxxxxxxxxxxxxxxxxi -v
Faker
└── i_groups=> Seo Taiji and Boys
Same with example 1, where "as" is in the search term "yeast"
Edit: maybe I should split this out as a separate issue?
Thanks for reporting this @richardbulger . This is actually an Open Issue on Fakerbot https://github.com/akabiru/fakerbot/issues/8 .
At the moment, search only matches against the method name parts -> https://github.com/stympy/faker/blob/master/lib/cli/reflectors/search.rb#L39-L42 I'm very open to suggestions on how we could improve the search algo. 🙂
Hey folks, @jdcorley has been looking into this on https://github.com/akabiru/fakerbot/issues/8 - we're shifting the conversation here. 🙂
The list reflector actually builds a hash of faker constants and their methods via the Reflectors::List#all_descendants_with_methods method.
We could potentially search against that data store? i.e. match against the constant (key) and also the methods

Curious to know what you think.
Sounds good to me. I think it's valuable that it searches full namespace hierarchy (eg TvShows and BojackHorseman) along with the methods.
I think it would be good if it lists the methods of the namespace in the results, also
@Jdcorley any update on this one? Please shout if you have any Qs. 🙂
@akabiru I’m very close to solving it haha I have the search including the namespaces now but now it’s just dumping all the namespaces during the search plus any methods that match the query. So I’m working on getting it to select the right namespaces to return relevant to the query.
Awesome! Feel free to raise a Draft PR maybe we can help unblock that bit. 👍
We should be able to close this issue. Resolved in https://github.com/faker-ruby/faker-bot/pull/38