Skip to main content.
home | support | download

Back to List Archive

Re: searching for literal ()

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Mon Mar 07 2005 - 20:46:32 GMT
On Mon, Mar 07, 2005 at 12:17:28PM -0800, Peter Karman wrote:
> Ok, I give up. I think this is possible but I can't remember how.
> 
> I have a word like this: (barfoo)

At one point I think you could just backslash it.

> karpet@cartermac 21% swish-e -w '\(barfoo\)'
> # SWISH format: 2.4.3
> # Search words: \(barfoo\)
> # Removed stopwords:
> err: Syntax error in query (missing end quote or unbalanced parenthesis?)

Try disabling that code and see if it works.

Damn query parser.  Can you fix all the issues with it while you are
in there?

I thought '"(barfoo)"' would work, though.  Although I can imagine a
number of reasons why it might not, too....

Oh, this is so ugly.  How about this:

Index: search.c
===================================================================
RCS file: /cvsroot/swishe/swish-e/src/search.c,v
retrieving revision 1.138
diff -u -B -r1.138 search.c
--- search.c    14 Feb 2005 20:38:21 -0000      1.138
+++ search.c    7 Mar 2005 20:44:40 -0000
@@ -1237,7 +1237,7 @@
 
         /* Is this the start of a sub-query? */
 
-        if (word[0] == '(')
+        if (word[0] == '(' && '\0' == word[1])
         {


-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Mon Mar 7 12:46:33 2005