devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Function "->" is not returned for Clojure search

Open dottedmag opened this issue 7 years ago • 4 comments

How to reproduce:

  1. Go to devdocs.io
  2. Enable Clojure documentation
  3. Search for ->

Expected output:

  1. -> is found

Actual result:

  1. -> is not found.

Additional info:

Seems to be specific to this particular function, as - + ->> -' are returned when searched for.

dottedmag avatar Jun 02 '18 14:06 dottedmag

This seems to be an issue with the search indexing. The -> entry can still be accessed but it just is not shown in search. I'm still not sure exactly what the issue is, though.

Searching for . and .. have the same issue.

image

beaucarnes avatar Jun 14 '18 19:06 beaucarnes

From what I see, all the examples you mention are "special characters". Chances are they are not correctly escaped when searching?

allentiak avatar Mar 16 '19 20:03 allentiak

->> works fine, so it's not escaping.

- and > are not special characters for Clojure.

dottedmag avatar Mar 16 '19 20:03 dottedmag

Just in case anyone is curious as to why this happens...

The -> string is part of SEPARATORS_REGEXP in searcher.coffee ( /#|::|:-|->|$(?=\w)|-(?=\w)|:(?=\w)|\ [/-&]\ |:\ |\ /g )

When normalizing the query string is equal to a SEPARATOR, it is ignored. So according to the code, -> will never return anything (search is considered invalid)

mberube avatar Nov 10 '20 06:11 mberube