-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fakerbot not searching namespace #1566
Comments
@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:
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 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 |
@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 akabiru/faker-bot#38 |
Example1:
Note that the first result for
beer
returns nothing. But the second foryeast
, which is a method ofbeer
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:
Doesn't return any simpons namespace stuff, but returns a Kpop one...
The text was updated successfully, but these errors were encountered: