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

Re: Adding a new field...

2002-04-03 01:08:28
In article <3CA9DD33(_dot_)1080705(_at_)rovia(_dot_)com>
carlos(_at_)rovia(_dot_)com writes:

How difficult would it be to add an additional field (for example, 
number of pages) to the Namazu document information?

It depends on kind of format.

For example, rfc822 messages are easy to do it. filter/mailnews.pl
creates field indexes of all headers in messages. But not of all
outputted, only bound to $SEARCH_FIELD variable in mknmzrc.

The following is an example of a part of mknmzrc.

$SEARCH_FIELD = 
"message-id|subject|from|date|uri|newsgroups|to|summary|size|x-ml-count";
%FIELD_ALIASES = ('title' => 'subject', 'author' => 'from',
                'x-mail-count' => 'x-ml-count',  'x-sequence' => 'x-ml-count');

It means:
* Output NMZ.field.x-ml-count
* x-mail-count and x-sequence header is treated as same as x-ml-count

As a result, the following query is treat as valid stuff by namazu.cgi.

http://search.namazu.org/cgi-bin/namazu.cgi?query=%2Bx-ml-count%3A00250&idxname=namazu-users-en

So if you want to add some field,
* Need to add fields to $SEARCH_FIELD in mknmzrc field
* Need to modify filter/* appropriately

I hope it helps you.
-- 
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>