namazu-users-en
[Top] [All Lists]

Re: Symbol matching

2001-05-07 04:16:49
In article 
<Pine(_dot_)LNX(_dot_)4(_dot_)21(_dot_)0105071445001(_dot_)8519-100000(_at_)bigears(_dot_)ncst(_dot_)ernet(_dot_)in>
philip(_at_)konark(_dot_)ncst(_dot_)ernet(_dot_)in writes:

It is very hard to achieve it on the standard framework. It should be
done with some CGI wrapper that it converts a query into splitted

I would have done a wrapper in perl, but that would make it slower
so I may have to do it in perl. For now, i think I will just stick
to replacing ,.;:? with space.

Hmm, it should be more easy that you modify src/namazu-cgi.c, like the
following:

-- 
*** namazu-cgi.c        Tue Mar 14 00:32:04 2000
--- namazu-cgi.c.new    Mon May  7 19:49:56 2001
***************
*** 179,184 ****
--- 179,186 ----
       *       Because the default index can be set in namazurc.
       */
      init_cgi(query, subquery);
+     replace_query(query);
+     replace_query(subquery);
  
      if (namazu_core(query, subquery) == ERR_FATAL) {
          die(nmz_get_dyingmsg());
***************
*** 186,188 ****
--- 188,202 ----
  
      return 0;
  }
+ void replace_query(char *query)
+ {
+   char c;
+   char repchars[] = ",.;:?";
+   while (*query != 0) {
+     if (strchr(repchars, *query)) {
+       *query = ' ";
+     }
+     query ++;
+   }
+ }
+ 
-- 
(This patch is not tested.)

By the way, there is a perl module named Search::Namazu.
<http://www.namazu.org/~knok/Search-Namazu-0.13.tar.gz>
It is a perl interface for libnmz.

Also, is there any way to change the default matching from AND to OR?

It should be needed modifying source, maybe nmz_expr() function in
nmz/parser.c?
-- 
NOKUBI Takatsugu
E-mail: knok(_at_)daionet(_dot_)gr(_dot_)jp
        knok(_at_)namazu(_dot_)org / knok(_at_)debian(_dot_)org


<Prev in Thread] Current Thread [Next in Thread>