Skip to main content.
home | support | download

Back to List Archive

substituing metaname operator character

From: Glenn Hammonds <rghammonds(at)not-real.gmail.com>
Date: Mon Feb 20 2006 - 20:31:43 GMT
Thanks for swish-e: I'm finding it quite useful.

Limiting search to specific properties is a powerful feature, but it
can be confusing for users.  This is especially true if they are
confronted with almost but not quite identical search interface
requirements in different contexts.  In the interests of removing one
of the differences between swish-e and other search engines in this
regard, I wanted to explore the possibility of changing the swish-e
metaname operator character "=" to ":".

I believe this is possible with just the source changes noted below;
compilation and execution was as expected, I've experienced no
difficulties with (admittedly limited) testing to date.  In an index
with the metaname "author" enabled, searches like author:dickens work
as expected, replacing the stock author=dickens.

Is this a good idea or a bad idea?  Why?

##########################################################
diff tmp/search.c 2.4.3/search.c
2165c2165
<     if (!strcmp(searchWord->line, ":"))
---
>     if (!strcmp(searchWord->line, "="))
diff tmp/swish_words.c 2.4.3/swish_words.c
116c116
<         : ( '(' == c || ')' == c || ':' == c || '*' == c || c ==
phrase_delimiter );
---
>         : ( '(' == c || ')' == c || '=' == c || '*' == c || c == phrase_delimiter );
834c834
<             if ( first_char == ':' )
---
>             if ( first_char == '=' )
978c978
<             newp = (struct swline *) addswline(newp, ":");
---
>             newp = (struct swline *) addswline(newp, "=");
1054c1054
<             if(prev && prev->line[0]!=':' && prev->line[0]!='(')
---
>             if(prev && prev->line[0]!='=' && prev->line[0]!='(')
Received on Mon Feb 20 12:31:46 2006