Closed tobias closed 1 year ago
Note that neil currently fixes this by wrapping the query in double quotes:
I "fixed" this by converting foo/bar
tokens to a search for group-id:foo AND artifact-id:bar
, but based on discussion in https://github.com/babashka/neil/pull/158, @borkdude and I realized this may not have been the best approach, since you generally don't need to search if you already know the exact group & artifact. So I think we should take a different approach to fixing this.
A simple change would be to escape /
in tokens. That would at least satisfy the lucene query parser, and foo\\/bar
will then match foo/bar
in the search doc content.
@tobias I think the change was good but maybe the result set should be joined with what was returned before.
I was also surprised that partial matches like babashka/cli
(rather than org.babashka/cli
) didn't return anything for the group / artifact query.
I think the change was good but maybe the result set should be joined with what was returned before.
I think joining makes sense. We can do ((group-id:foo AND artifact-id:bar) OR "foo/bar")
, which would then include the prior results as well.
I was also surprised that partial matches like babashka/cli (rather than org.babashka/cli) didn't return anything for the group / artifact query.
This is because group-id
and artifact-id
are exact matches, not fuzzy. I have some ideas on how to improve the results in cases like this, but I don't know if they will work. I'll play with that a bit and report back.
I've made the change to join the results, and made some changes to what we index, so you should get better results now. For example, https://clojars.org/search?q=babashka%2Fcli finds org.babashka/cli
now, and https://clojars.org/search?q=org.clojure%2Ftools.cli finds org.clojars.rmremizov/clj-argparse
.
Let me know how it works for you @borkdude!
I can confirm it works a lot better now! Thanks!
My pleasure!
On Wed, Feb 1, 2023, at 08:49, Michiel Borkent wrote:
I can confirm it works a lot better now! Thanks!
— Reply to this email directly, view it on GitHub https://github.com/clojars/clojars-web/issues/856#issuecomment-1412089632, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAURYYXLTKXHHFWU3Y553WVJSYBANCNFSM6AAAAAAULCOCCY. You are receiving this because you modified the open/close state.Message ID: @.***>
Searching for a string with a / in it (like
tools/cli
) results inThis is because we have a catch-all exception handler around search, and return this generic error on failure. The root cause is:
Wrapping the query in qoutes works.
We could do a couple of things:
foo/bar
tokens to a search forgroup-id:foo AND artifact-id:bar
/
in quotes