tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Support for boolean queries in apropos



On Thu, 15 Mar 2012, James K. Lowden wrote:

> > as this is a human interface tool, not a database selector.
>
> Erm, the relational model adopted Boolean logic to provide a human
> interface to data.

Sure, but that doesn't mean that we should expose raw query syntax in the
interface. That people innately understand it doesn't mean they can
compose logical queries.

> > % apropos -8 "add new user" -git -ssh
>
> [scratching head] What does the -git option to apropos do?  Is -8 an
> option, or part of the query syntax?  I think (honestly) you meant "not
> 8", but I read it as "only 8".

-8 is equivalent to "-s 8" in this case, limiting search queries to
section 8 of the manual.

> Does this really mean the same?
>
>       % apropos -8 -git -ssh "add new user"

No that would cause an error because -g, -i and -t are undocumented as
options. Neither is "sh" a known section.

option processing stops at the first non-option argument; that is in POSIX

You might consider that a negative search term is not relevant if there is
no postive search term, so having an error returned when you don't start
with a positive search term doesn't seem likely to cause much trouble.

> My version of your query suggests, on a command line, something very
> different from what you intend, or what would be expected in a search
> box.  The same cannot be said of
>
>       % apropos 8 not git and not ssh and "add new user"
> or
>       % apropos 8 'not (git or ssh) and "add new user" '

does that include all pages with an 8 in, or is that limited to section 8
pages?

> We should look to our own tradition here, not import a
> syntax-of-the-masses just because it happens to be familar in 2012.

I'm thinking of the process from a users perspective..

% apropos "add new user"
<get loads of pages, seems a bunch about ssh which I don't want>
% !! -ssh
<loads more pages, notice lots of git stuff which I don't want>
% !! -git
<a shorter list and there I see the one I wanted>

but in truth I think that having a full-text apropos search is great
anyway and I just wanted to voice the concept that working on too many
features may not be all that valuable (except as I said, an academic
exercise :)

regards,
iain


Home | Main Index | Thread Index | Old Index