Skip to content
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

Search syntax documentation #131

Open
3 tasks done
kidonng opened this issue Mar 31, 2023 · 4 comments
Open
3 tasks done

Search syntax documentation #131

kidonng opened this issue Mar 31, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request pr welcome

Comments

@kidonng
Copy link
Contributor

kidonng commented Mar 31, 2023

Clear and concise description of the problem

#85 added advanced search syntax powered by fzf, but it is not documented anywhere, thus probably little-known.

With recent updates, searching icons (especially all icons) becomes less intuitive:

image

To get results comparable to the official Iconify website, one needs to use special syntax like 'heart 'fire:

image

Suggested solution

Ideally there should be a section/page mentioning how you can use advanced syntax to narrow search results.

Alternative

No response

Additional context

No response

Validations

@kidonng kidonng added the enhancement New feature or request label Mar 31, 2023
@antfu
Copy link
Member

antfu commented Apr 3, 2023

Yeah sure, PR welcome

@sqwishy
Copy link

sqwishy commented May 14, 2023

Wow this would be great. I'm glad I saw this issue. The current search is ridiculous.

Searching Solar for "trash" gives you bandages, dumbbells, underwear, phones, bedside tables, lots of arrows, a ladle? and a bunch of other things that don't make sense.

If you search All for "add bullet" there's a bunch of arrows, people playing basketball ... 90% of these results don't seem related to the query at all. It's wild.

Edit: It looks like if you search All collections for 'table it matches everything from the Tabler collection because those icon names begin with the "tabler:" prefix? (Can get away with searching table$ or 'table: instead...)

@leeoniya
Copy link

leeoniya commented May 28, 2023

might i suggest switching from fzf to something much faster and much less 🤯 ?

https://github.com/leeoniya/uFuzzy#a-biased-appraisal-of-similar-work

vs fzf-for-js:
https://leeoniya.github.io/uFuzzy/demos/compare.html?libs=uFuzzy,fzf-for-js&search=super%20ma

(happy to help out if interested)

EDIT:
out of curiosity, i created a full list of all ~205k current icons and aliases from @iconify/json [1]: icons.zip. you can drag-drop this into the yellow box of the demo link above. e.g. with typo tolerance and out-of-order terms:

image

[1] https://www.npmjs.com/package/@iconify/json

@antfu antfu added documentation Improvements or additions to documentation pr welcome labels Apr 8, 2024
@cyanxxx
Copy link
Contributor

cyanxxx commented Apr 16, 2024

When I am typing the "cat", I hope the cat can priority display. Can it add the sort function to rearrange the search result? I found Fzf can take tiebreakers: [ byLengthAsc ] to decide sort order.
cat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request pr welcome
Projects
None yet
Development

No branches or pull requests

5 participants