42bytes-team / wfm-seeker

Fuzzy search component from `warframe.market`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider using a string similarity algorithm: levenshtein to optimize the search experience

I-Want-ToBelieve opened this issue · comments

(^|.*?\\s·)(inputValue)
image

(^|.*?\\s·)*(inputValue)
image

let regexBase = parts.reduce((regexBase, part, index) => (part.length > 0 ? (regexBase += `(^|.*?\\s·)(${part})`) : regexBase), '');

I'm not sure how it will affect the textNodes in the DropdownInner component

textNodes.push(<b key={cnt}>{name.slice(charIndex, charIndex + matchedlenght)}</b>);

@KycKyc can you tell me where is the items data (field in SeekerProps) in the network request

interface SeekerProps<Item> {
    ...
    items: Item[];
    ...
}

image

@KycKyc can you tell me where is the items data (field in SeekerProps) in the network request


interface SeekerProps<Item> {

    ...

    items: Item[];

    ...

}

image

@I-Want-ToBelieve I believe you're trying to look for the items endpoint

commented

if you want to feed it with "something" and test results, you can use:

type Item = {
    id: string;
    group: string;
    name: string;
};

adding a * or not doesn't affect the result of regex matching, it gives the exact same groups
the regex here is used for splitting user's input and match with item names
e.g. user input N S, it will be splitted into [N,S]
and (^|.*?\s)(N)(^|.*?\s)(S) can also match with Nekros Prime Set even without the *

thus, I'm going to close this issue, you can open another issue for other suggestions