luarocks / luarocks-site

LuaRocks website and module host
http://luarocks.org
175 stars 36 forks source link

How exactly does search in luarocks.org work? #81

Closed hishamhm closed 8 years ago

hishamhm commented 8 years ago

AFAICT search includes the description fields (nice!), e.g.

But these searches gave me surprising results:

leafo commented 8 years ago

Not very well, I need to spend some time tweaking it.

Right now it uses postgres fulltext search, indexed on a concatenation of the module title, summary, and description: https://github.com/leafo/luarocks-site/blob/master/models/modules.moon#L80 (the index is described here: https://github.com/leafo/luarocks-site/blob/master/models/modules.moon#L39)

Another fatal flaw is that it currently sorts by downloads for whatever reason.

"protocol buffers" not matching is strange, I think there's a bug somewhere that's misinterpreting the space as a different character (looks like a +). Additionally direct matches should definitely be bumped to the top (and if there are multiple it makes sense to sort by downloads there)

leafo commented 8 years ago

It's not perfect yet, but should be significantly improved

leafo commented 8 years ago

Okay it should be much better now.

There are still some things that can be improved, for example

searching for "lua socket" or "socket" does not find "LuaSocket"

I'm going to create a general issue where people can post issues where search isn't returning what they expect.