-
-
Notifications
You must be signed in to change notification settings - Fork 685
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
Rework Object searching to behave more consistently #3541
base: main
Are you sure you want to change the base?
Rework Object searching to behave more consistently #3541
Conversation
Whoops. Converting this to a draft because a) there's more failing unit tests, and b) I just realized while working on adding new tests for the two methods I modified that I unwittingly lost the match scoring mechanism. Since that needs to be accounted for, I need to rethink some of my changes to |
On further review of how The failed unit tests are a bit more of a pain, however. It seems as though the clothing contrib, rather than having a proper usage feedback on the |
@@ -85,7 +85,10 @@ def test_clothingcommands(self): | |||
) | |||
|
|||
# Test remove command. | |||
self.call(clothing.CmdRemove(), "", "Could not find ''.", caller=self.wearer) | |||
# NOTE: commenting out due to failing via the search refactor - however, this command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've temporarily just commented out this assertion since I intend to make a second PR to correct the oversight in the contrib command, but I'm unsure if this is the correct approach.
I could alternatively write the other PR, wait for it to be merged, and rebase this one onto it.
Or, I could leave this one failing with the assumption I'll correct it. (I'm not a fan of this third option. >.>)
Brief overview of PR changes/additions
This PR makes modifications to both the DefaultObject manager methods of
get_objs_by_key_and_alias
andsearch_object
.get_objs_by_key_and_alias
will now properly respect partial matches in its queries, leading to the expected result of an empty search string partial-matching all candidates and additionally running fewer queries.search_object
has been moderately streamlined, removing the need for special-case handling of tags or search terms, and applying all filtering keywords consistently to all types of searches rather than unintuitively picking and choosing based on which combination of keywords were provided.Motivation for adding to Evennia
Usability improvements
Other info (issues closed, discussion etc)
The undesirable behavior brought up on Discord where searching with tag criteria but no search string is resolved by this PR. It additionally resolves several equally problematic behaviors that currently result when giving the search method an empty search string, such as returning an empty result when people typically expect an empty string to partial-match all keys not none, and the unfortunate tag-only search disregarding all other keywords entirely.