clojars

borkdude 2023-01-29T13:26:44.423029Z

Hey :) Why does a search query with a / in it has to be double url-encoded?

GET /search?q=tools%2Fcli&format=json
This will fail

2023-01-30T12:18:51.236399Z

Thanks for the report! I created https://github.com/clojars/clojars-web/issues/856 to look at it further.

borkdude 2023-01-30T12:23:40.063329Z

Thanks! Could be a feature or a bug, I'm not sure. I posted in the issue how I currently work around it

2023-01-30T12:25:55.065139Z

Thanks! I'll try to take a look at it this week.

2023-01-30T12:27:57.027779Z

Based on this in your search help: > Note that Clojars stores the namespace and name of a library as separate attributes, so searching for a ns-qualified library will not necessarily return any matches: It seems like splitting / to group-id:... AND artifact-id:... might be a good solution.

borkdude 2023-01-30T12:28:58.853529Z

This does work:

$ neil dep search org.clojure/tools.cli
:lib org.clojars.rmremizov/clj-argparse :version 0.1.1-SNAPSHOT :description "A convenience wrapper around org.clojure/tools.cli"

borkdude 2023-01-30T12:29:14.557579Z

But this doesn't:

$ neil dep search org.clojure/tools
Unable to find org.clojure/tools on Clojars.

borkdude 2023-01-30T12:29:38.357489Z

the first result is also a bit weird

borkdude 2023-01-30T12:30:19.967989Z

I can compensate for this in neil, but maybe it should be done in clojars?

2023-01-30T12:31:23.056749Z

I think it is because wrapping in quotes tells lucene to match for the exact phrase. And yes, I think clojars should fix this. By > It seems like splitting / to group-id:... AND artifact-id:... might be a good solution. I meant within clojars search implementation.

borkdude 2023-01-30T12:31:41.464799Z

oh I see

2023-01-30T12:32:54.526789Z

I think a non-quoted foo/bar would become group-id:foo AND artifact-id:bar, but "foo/bar" would be left alone. You could then remove the quoting in neil, and the searcher would have control over searching as a phrase or not

borkdude 2023-01-30T12:34:16.187909Z

sounds good

borkdude 2023-01-29T13:36:42.220689Z

It will succeed when I wrap %22 around it