[racket] ranking of search results in documentation search

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Fri Dec 24 16:48:53 EST 2010

I think that some tweaking to the ranking of documentation search 
results would help.

Oftentimes, I find that I have to scan down the search result list 
looking at the small text at end end of each search result line to find 
an appropriate manual, and only then look to the left at the titles.

Here's an example...

> (rnrs io ports (6)): I/O: Ports  in r6rs
> Attaching Documentation to Exports  in syntax
> clear-output-ports (method of text:ports<%>)  provided from framework
> Creating Ports  in reference
> Custom Ports  in reference
> Default Ports  in guide
> Exports: provide  in guide
> File Ports  in reference
> Fine-Grained Control Over Package Imports  in planet
> Garbage Collector Exports  in plai
> gunzip-through-ports  provided from file/gunzip
> gzip-through-ports  provided from file/gzip
> Imports: require  in guide
> input ports, pattern matching  in reference
> Managing Ports  in reference
> module->exports  provided from racket/base, racket
> module->imports  provided from racket/base, racket
> module-compiled-exports  provided from racket/base, racket
> module-compiled-imports  provided from racket/base, racket
> modules, imports  in reference

In this particular case, I would've preferred to see the hits in the 
"guide" and "reference" manuals ranked higher than "syntax", 
"framework", and "r6rs" ones.

As a simple improvement, perhaps, for example, "guide" and "reference" 
should be weighted more than "r6rs", in addition to whatever other 
ranking is used, like TFIDF and whether there is an exact match for a 
language identifier.  This weighting by manual could be dependent on a 
"context" query in the URL, which, when invoked from DrRacket, could 
depend on the "#lang" line.  (Looking at all the "require"s in effect 
would be a lot trickier, but the "#lang" line is easy.)  There could be 
a little selection box beside the search text field, so that the user 
could see the context bias and control it.


Posted on the users mailing list.