icones icon indicating copy to clipboard operation
icones copied to clipboard

Search syntax documentation

Open kidonng opened this issue 1 year ago • 4 comments

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

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

kidonng avatar Mar 31 '23 08:03 kidonng

Yeah sure, PR welcome

antfu avatar Apr 03 '23 12:04 antfu

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...)

sqwishy avatar May 14 '23 00:05 sqwishy

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

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

leeoniya avatar May 28 '23 15:05 leeoniya

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

cyanxxx avatar Apr 16 '24 06:04 cyanxxx