-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use asearch #55
Use asearch #55
Conversation
PR ありがとうございます! レビューします 👀 |
const target = item.searchableText.toLowerCase(); | ||
return target.includes(query.toLowerCase()); | ||
}); | ||
const maxAambig = Math.min(Math.floor(query.length / 4) + 1, 3); |
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.
メモ: あいまい度は0〜3しか指定できないので Math.min している
http://shokai.org/blog/archives/8471
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.
素朴な疑問: ちなみに Math.floor(query.length / 4) + 1
という式で あいまい度を算出しているのには、何か理由があるのでしょうか? どういう理由でクエリの長さを使ったり、それを4で割ったり、最後に1を足したりしているのかが、差分からだと読み取れず、気になったという次第です。
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.
素朴な疑問: ちなみに
Math.floor(query.length / 4) + 1
という式で あいまい度を算出しているのには、何か理由があるのでしょうか? どういう理由でクエリの長さを使ったり、それを4で割ったり、最後に1を足したりしているのかが、差分からだと読み取れず、気になったという次第です。
クエリが長くなるほど打ち間違いが多くなりそうなので、クエリ長に比例して許容できるあいまい度を大きくしました。
具体的な数値に深い理由はありません。単にemoji selector 181行目の設定に倣っただけです。
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.
承知です〜。何か意図あるか気になっただけで、僕もどうしたいとか強い拘り今のところ無いので、一旦このままにしてリリースして様子みようと思います 👍
SHOULD: ここのテストケース名も fuzzy search がされることが分かるような文言に変えて頂きたいです!
|
https://github.blog/2021-04-22-github-actions-update-helping-maintainers-combat-bad-actors/ に従って CI 走らせる権限を付与しようとしてみたのですが、何故かどこにも |
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.
- いくつか気になったところにコメント書きました
- 検索便利にしたいなと思いつつ、あんまり高級なものを使うと bundle size が大きくなりそうで躊躇していたので助かりました! これくらいのサイズなら気軽に入れられそうです。
- コメント書いたところお返事頂けたり、修正していただけたら approve できそうです
- MAY の点に関しては対応してもしなくても大丈夫という温度感です
とりあえず「あいまい一致」にしてみました。言い回しが変であればご指摘お願いします |
メモ: すみません、後出しで申し訳ないのですが、ちょっと気になるポイントがあったのでメモしてみます。
|
文言これで問題なさそうです! |
#55 (comment) にある通り、 |
ああなるほど! ようやく理解しました 🙇 であれば大丈夫そうですね。 |
- テストでは fuzzy search を無視できるよう、文字数を多くすることに
CI 通るようにちょっと手直ししてマージしました。 PRありがとうございました!! @takker99 |
あいまい検索library asearchでアイコンを絞り込むようにしてみました。
環境の都合上、E2Eテストだけ確認できていません。他のテストは通ることを確認しました