[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: client/server module and other wishes

On Wed, 26 Sep 2001, Olivier Thereaux wrote:

> namazu.cgi is good, and flexible, but I don't like it. My main
> reproach (and the reason why I will not use it) is that all the
> query *has* to be in the keyword field. I would prefer (because it's
> better for users, as they don't have to learn the syntax) something
> like:

I don't think I understand what you mean by `query has to be in the
keyword field'.  AFAIK, the query terms can be anywhere in the body of
the document searched, not necessarily in the keyword field.  Also, your
link doesn't work ( does not have a dns entry), so I can't
see what you want me to.

> As you can see, in this interface header search is possible directly,
> whereas with namazu.cgi, one needs to learn the syntax (and believe me,
> many people don't, and this is why "simple" search engines are popular

What syntax is this?  I've been using namazu for quite some time, and
all my users took straight to it.  I didn't give anyone any training,
they just intuitively knew how to search. is an example.  See the search box on the
top left.

> I wanted to use namazu as a back-end (calling it from a script which
> re-builds a query namazu understands), but if I do this, All I get is:
> 	You should use "namazu.cgi" instead of "namazu" command.

You get that message when namazu.cgi detects that it is being run in a
CGI environment.

From namazu-cmd.c:

    if (getenv("QUERY_STRING") && getenv("SCRIPT_NAME")) {
         * If invoked as CGI, print a help message and exit.
         * NOTE: Since "namazu" command and "namazu.cgi" had
         * been same until 1.9.13, there might be a lot of
         * people trying to use "namazu" command as CGI. But
         * since 1.9.14, they are different and we cannot
         * use "namazu" command as CGI any longer.
        printf("%s %s" CRLF CRLF, MSG_MIME_HEADER, contenttype);
        printf("You should use \"namazu.cgi\" instead of \"namazu\" command.");

You can see, that this is quite logical behaviour.  If you still want to
use namazu instead of namazu.cgi, then just unset QUERY_STRING and
SCRIPT_NAME.  In any case, it isn't safe to exec processes without first
setting a restrictive environment.

> I understand namazu developers want to advertize namazu.cgi, but
> using namazu itself shouldn't be forbidden.

Well, I'm not one of the developers, but I don't think that this was the

> Is there a work-around? If there isn't, please remove this restriction.

See above.

> Number three :
> Again, namazu.cgi is good, but not good for everyone. Some people may
> want the cgi to output xml, and not html, but they can't. I would like

Change your templates.  You can get different output, although not as
flexible as is wanted.  I agree with you on this point, because I have a
90% xhtml site, with only my search page in html, simply because namazu
generated code cannot be made into xhtml.  I'm working on moving all
design related features into the templates - mainly for my personal use,
but if it works out well, I'll release it on this list.

> good engine, but being tied to the binary or the cgi is not "cool"
> for developers, and having to re-write everything is a waste.

Well, you don't really have to rewrite everything.  Dig into the source
for a while.  It isn't that well commented, but the code is legible, and
not too hard to understand if you know C.

> A *great* thing would be to develop, as a base for both namazu and
> namazu.cgi, or in parallel to namazu, a client-server module that
> various clients, including namazu.cgi and namazu, could call.

This would be a good idea, although you might want to try libnamazu
first.  No docs though.


"Dad buried in landslide! Jubilant throngs fill streets! Stunned father
inconsolable - demands recount!"
		-- Calvin

Visit my webpage at
Read my writings at

  MSN  philiptellis                         Yahoo!  philiptellis
  AIM  philiptellis                         ICQ     129711328