Skip to main content.
home | support | download

Back to List Archive

Re: searching for *

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Jan 02 2004 - 15:42:45 GMT
On Fri, Jan 02, 2004 at 03:37:48AM -0800, Mark Tynan wrote:
> Is it possible to make swish find a star *, or a string of stars =
> ******** ?

It seems not, due to a bug in the query parser[1].

Here's why your tries won't work:

> $ swish-e -w "*" -H 9

All those quotes are doing is escaping from the shell.  So you get:

> err: Single wildcard not allowed as word


> $ swish-e -w '"*"' -H 9

Now you are placing the * in a phrase.  But it still is considered a 
wild card -- you can use wild cards in a phrase.

moseley@bumby:~$ cat 1
hello world
moseley@bumby:~$ swish-e -i 1 -v0
moseley@bumby:~$ swish-e -w '"hello world"' -H0
1000 1 "1" 12
moseley@bumby:~$ swish-e -w '"hel* world"' -H0
1000 1 "1" 12

But you the search parser is not seeing that error, but you get the same 
result:

> # Search words: "*"
> # Parsed Words:
> err: No search words specified


What you _should_ be able to do is:

  $ swish-e -w '\*'

the quotes protect both chars from the shell.

What you _can_ do is this:

  $ swish-e -w 'foo\*bar'

moseley@bumby:~$ swish-e -w 'hello*there' -H0
err: Wildcard not allowed within a word

moseley@bumby:~$ swish-e -w 'hello\*there' -H0
1000 1 "1" 18

I'll see if I can get a patch to fix that.


[1] The query parser really needs a rewrite. I didn't get any response
from http://swish-e.org/archive/6204.html



-- 
Bill Moseley
moseley@hank.org
Received on Fri Jan 2 15:42:59 2004