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 Mon, Mar 12, 2012 at 06:45:15AM +0200, Alan Barrett wrote:
> On Sun, 11 Mar 2012, Abhinav Upadhyay wrote:
> >The FTS engine of Sqlite supports Boolean queries. Boolean queries
> >simply means building complex queries by combining simple queries
> >using Boolean operators: AND, OR, and NOT. For example:
> >
> >$ apropos add new user NOT (git OR ssh)
> >
> >This will provide results which match the query "add new user" but
> >do not match for "git" or "ssh".
> 
> Instead of exposing the underlying syntax of the SQL engine, I would
> prefer to see a user interface syntax similar to that ptovided by
> google search.
> 
>         $ apropos 'add "new user" -(git|ssh)'
>         $ apropos add '"new user"' '-(git|ssh)'
> 
> where the outer quotes are for the shell, the inner quotes around
> "new user" mean that those two words must appear together, the "-"
> means the following term must not appear, the "|" means OR, and the
> parentheses are for scoping.  Not shown in the example is the "+"
> operator, which google search uses to mean that the term must
> appear, or that the term has a higher weight than other terms in
> determining the overall ranking of the results.

I did not think that Google used parentheses (or anything else) for
scoping?  Apropos should probably keep it simple and leave out scoping.

You can write the search above without parentheses like this:

$ apropos 'add "new user" -git -ssh'

Dave

-- 
David Young
dyoung%pobox.com@localhost    Urbana, IL    (217) 721-9981


Home | Main Index | Thread Index | Old Index