Bug - Not A Bug you know what, nevermind. Mall search: how does it work?

Grotfang

Developer
Strictly speaking, this is a feature request.

You hit search, mafia checks tries to work out what you meant. It MAY fuzzy match the item (it will if it can). It will then search for the fuzzy match. That is what it *should* do, according to the code. You have an interesting point though. What are other people's opinions on this? Should mafia display all possible results, or is it nice to be given a single item?

EDIT: I'm wrong. See below. The matching is incomplete -- it does NOT try to find a single match. It just happens that in this example, only one match is found.
 
Last edited:

slyz

Developer
I don't have all of the items that contain "lun", but doing this:
Code:
> inv lun

hyperinflated seal lung (38)
Knob Goblin lunchbox
returns at least two items, however:
Code:
> ash to_item("lun");

Returned: Knob Goblin lunchbox

Searching for "lun" in the mall through the relay browser does return several items, so it's not KoL's matching doing this.
 

StDoodle

Minion
Moving this thread to "Community Support," since it isn't actually a bug, but more of a request for explanation. If different behavior is desired, please feel free to post as a Feature Request.
 

Grotfang

Developer
So, apparently I was wrong. As things go, mafia does return everything it matches. However, the example used (lun) only matches 3 things, and they aren't the same as what KoL does:

hyperinflated seal lung
knob goblin lunchbox
sack lunch

Since sack lunch and seal lungs are untradable, mafia is (from that list) correctly only searching for the lunchbox.

A better example of mafia's search results comes about from typing in "sea". This matches a lot. And we get a lot.

This can probably be counted as a bug, since KoL is returning more items. For the record, the missing items from mafia's lun return are:

blundarrrbus
gnollish autoplunger
gnollish plunger
papaya slung

Could someone with any of these items in inventory confirm that they turn up when typing "inv lun" into the CLI?
 

slyz

Developer
Code:
> inv lun

blundarrrbus
Gnollish autoplunger
Gnollish plunger
hyperinflated seal lung (40)
Knob Goblin lunchbox
papaya slung

Edit: as noted above, the ASH to_item() function uses the same StringUtilities.getMatchingNames() function in the end. Unfortunately, I do not understand how StringUtilities.getMatchingNames() works (it uses hashes).

I thought that it only matched if the search string was at the beginning of a word, but searching the mall for "gno" returns eggnog as well as other items containing "gno".
 
Last edited:

jasonharper

Developer
If there are substring matches starting at a word boundary (like 'lun' matching 'lunch'), no further matching is tried. The whole point of mafia's fuzzy matching is to try to find the single item that the user was trying to refer to, not to find multiple matches.
 
Top