Open timotheecour opened 7 years ago
We really need to work on the search functionality. Using MongoDB's text search functionality improved parts, but regressed on others. Matching single-character words like in this case is one of them.
I don't understand. Why not use regex or even exact search? eg: dub search --regex '^msgp.*' => should match msgpack-d,msgpack-rpc dub search 'sgpack-d' => should match msgpack-d (eg using std.algorithm.canFind)
also, dub search msgpac
returns nothing
after digging through code to understand what's going on I found this: dlang/dub-registry/source/dubregistry/dbcontroller.d:
return m_packages
.find(["$text": ["$search": query]], ["score": bson(["$meta": "textScore"])])
https://docs.mongodb.com/manual/text-search/#exact-phrase shows exact phrase can be used using double quotes, indeed:
dub search '"msgpack-d"'
msgpack-d (1.0.0-beta.6) MessagePack for D.
However I don't understand other queries, eg:
dub search '"base"'
...
exceptions (0.2.3) Standard user exception classes.
...
why ???
Also: suffix search works:
dub search '"gpack-d"'
msgpack-d (1.0.0-beta.6) MessagePack for D.
but not prefix:
dub search '"msgpac"' => empty
Also, with "", the whole word is needed for suffix search including -d
:
dub search '"gpack"' => empty
Sounds like a registry issue, but still an issue nonetheless.
I believe the situation has improved but we're still seeing way too many packages being returned. Would that be something you would be interested in tackling @WebFreak001 ?
dub search msgpack returns
dub search msgpack-d returns all dub packages