Merge pull request #3434 from InspectorCaracal/help-fixes-1

Patches to improve "help" usability
This commit is contained in:
Griatch 2024-02-24 10:12:52 +01:00 committed by GitHub
commit ca6ea0c0aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 14 deletions

View file

@ -480,9 +480,9 @@ class CmdHelp(COMMAND_DEFAULT_CLASS):
# lunr search fields/boosts # lunr search fields/boosts
search_fields = [ search_fields = [
{"field_name": "key", "boost": 10}, {"field_name": "key", "boost": 10},
{"field_name": "aliases", "boost": 9}, {"field_name": "aliases", "boost": 7},
{"field_name": "no_prefix", "boost": 8}, {"field_name": "no_prefix", "boost": 6},
{"field_name": "category", "boost": 7}, {"field_name": "category", "boost": 5},
{"field_name": "tags", "boost": 1}, # tags are not used by default {"field_name": "tags", "boost": 1}, # tags are not used by default
] ]
match, suggestions = None, None match, suggestions = None, None

View file

@ -55,13 +55,4 @@ HELP_ENTRY_DICTS = [
""", """,
}, },
{
"key": "building",
"category": "building",
"text": """
Evennia comes with a bunch of default building commands. You can
find a beginner tutorial in the Evennia documentation.
""",
},
] ]

View file

@ -88,8 +88,8 @@ def help_search_with_index(query, candidate_entries, suggestion_maxnum=5, fields
if not fields: if not fields:
fields = [ fields = [
{"field_name": "key", "boost": 10}, {"field_name": "key", "boost": 10},
{"field_name": "aliases", "boost": 9}, {"field_name": "aliases", "boost": 7},
{"field_name": "category", "boost": 8}, {"field_name": "category", "boost": 6},
{"field_name": "tags", "boost": 5}, {"field_name": "tags", "boost": 5},
] ]