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

[Namazu-users-en] Re: Namazu encoding Unix vs win32

2006-06-24 12:20:38

 

 I'm trying to generate the Namazu index on Unix (FreeBSD) and search it
on win32.

'mknmz' is executed by UNIX and the index is made. 
It is possible to retrieve it by using the made index by 'namazu.exe' 
of Windows. 

The index is compatible. 

This is Good News !

 When the win32 search runs, a considerable amount of garbage is
produced, along
 with some echoing of templates.  Unix search works fine.

Please explain how to become it concretely. 

First of all, I'm running the Namazu.CGI.exe through shttpd
 on a win98 system

 Looks to me like it may be a coding problem.

What are grounds of which it thinks like that?

Just the fact that some help text from the template came through,
preceeded by unintelligible characters where the "hits" are normally seen.
Also, Namazu.cgi.exe finished normally without windows or shttpd seeing
any problem.
(I've had other search software get DLL errors and crash the system)

 mknmz scripts are identical on the two ports.

What does it mean?

It is necessary to execute mknmz only by UNIX. 
Moreover, the Windows version is mknmz.bat, and it is not the same 
as mknmz of UNIX in the batch file. 

to demonstrate:
 After removing the CR at the end of each remaining line,in mknmz.bat
as found in the nmz2.0.16.001-win32.zip distribution,
 this is the diff between the installed script from the FreeBSD port 
   (/usr/local/bin/mknmz) and the stripped .bat file:
$ awk '{print substr($0,1,length($0)-1 );}' < mknmz.bat > mknmz.bat.strip
$ diff mknmz.bat.strip /usr/local/bin/mknmz
1,14c1
< @rem = '--*-Perl-*--
< @echo off
< if "%OS%" == "Windows_NT" goto WinNT
< perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
< goto endofperl
< :WinNT
< perl -x -S %0 %*
< if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
< if %errorlevel% == 9009 echo You do not have Perl in your PATH.
< if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
< goto endofperl
< @rem ';
< #! /c/Perl/bin//perl -w
< #line 15
---
#! /usr/local/bin/perl -w
63,64c50,51
< my $PKGDATADIR    = $ENV{'pkgdatadir'} || "C:/namazu/share/namazu";
< my $CONFDIR       = "C:/namazu/etc/namazu";     # directory where
mknmzrc are in.
---
my $PKGDATADIR    = $ENV{'pkgdatadir'} || "/usr/local/share/namazu";
my $CONFDIR       = "/usr/local/etc/namazu";     # directory where
mknmzrc are in.
2699,2701d2685
< 
< __END__
< :endofperl

This is only a minor point, just to confirm my quick observation.
 All the perl code is identical after the .bat "wrapper".

 
--------

Here are the uncommented lines of /usr/local/etc/namazu/mknmzrc on FreeBSD:

 package conf;  # Don't remove this line!
 $HTML_SUFFIX = "htm";
 $ALLOW_FILE = ".*\\.(?:$HTML_SUFFIX)";

--------

Here are the uncommented lines of the namazurc in the windows98 system:
 Index         E:\install\cgi
 Template      E:\install\cgi
 ##Lang          ja_JP.SJIS
 #Lang     ja.EUC
 ##Lang        en
 ContentType     "text/x-html"
 
-- none of the Lang options seem to make any difference 
   I am unclear on their meaning for the win32 CGI

-------- 
 
Here are the uncommented lines of /usr/local/etc/namazu/namazurc on FreeBSD:
 Index         /var/NAMW
 Template      /var/NAMW
 
-- searching here works fine.

--------

Here is the Form.htm file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd";>
<html><head>
<title>Search Gospel Codes</title>
</head>
<body lang="en">
<h1>Search Gospel Codes</h1>
<hr>
<form method="get" action="namazu.cgi">
<input type="text" name="query" size="40" value="">
<input type="submit" name="submit" value="Search!"><br>
<!-- <input type="hidden" name="idxname" value="foobar"> -->
<b>Display:</b>
<select name="max">
<option value="10">10</option>

<option selected value="20" selected>20</option>
<option value="30">30</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
<b>Description:</b>
<select name="result">
<option selected value="normal" selected>normal</option>
<option value="short">short</option>
</select>

<b>Sort:</b>
<select name="sort">
<option selected value="score" selected>by score</option>
<option value="date:late">by date in late order</option>
<option value="date:early">by date in early order</option>
<option value="field:subject:ascending">by title in ascending order</option>
<option value="field:subject:descending">by title in descending
order</option>
<option value="field:from:ascending">by author in ascending order</option>
<option value="field:from:descending">by author in descending order</option>

<option value="field:size:ascending">by size in ascending order</option>
<option value="field:size:descending">by size in descending order</option>
<option value="field:uri:ascending">by URI in ascending order</option>
<option value="field:uri:descending">by URI in descending order</option>
</select>
</form>
</body>
</html>


Thanks for your help.

_______________________________________________
Namazu-users-en mailing list
Namazu-users-en(_at_)namazu(_dot_)org
http://www.namazu.org/cgi-bin/mailman/listinfo/namazu-users-en