Gnus development mailing list
 help / color / mirror / Atom feed
* local search engine?
@ 1999-01-23 21:40 Stefan Waldherr
  1999-01-24  3:31 ` Harry Putnam
  1999-01-24 17:58 ` local search engine? Kai.Grossjohann
  0 siblings, 2 replies; 20+ messages in thread
From: Stefan Waldherr @ 1999-01-23 21:40 UTC (permalink / raw)


Hi,

anyone knows of a search engine that lets me comfortably search my mail? For
some $#@#%^%@ reason, glimpse core dumps after 10 minutes of heavy indexing.

Thanks,
Stefan.
-- 
Stefan Waldherr                   fax +49 431 8058 136
                               e-Mail stefan@waldherr.org
                                  www http://www.waldherr.org/


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-23 21:40 local search engine? Stefan Waldherr
@ 1999-01-24  3:31 ` Harry Putnam
  1999-01-24  5:59   ` Matt Pharr
  1999-01-24 17:58 ` local search engine? Kai.Grossjohann
  1 sibling, 1 reply; 20+ messages in thread
From: Harry Putnam @ 1999-01-24  3:31 UTC (permalink / raw)


Stefan Waldherr <stefan@waldherr.org> writes:

> Hi,
> 
> anyone knows of a search engine that lets me comfortably search my mail? For
> some $#@#%^%@ reason, glimpse core dumps after 10 minutes of heavy indexing.

I suspect it would be well worth your while to try to get Glimpse
working on your system.   Then get Kai's nnir package to use with it.

Admittedly, I am something of a novice, but I found the other main
choice "FreeWais" to be hard as hell to install and learn to use.
Still haven't accomplished the second part.  Although Kai does supply
an example file to use with FreeWais in his nnir comments.

Kai keeps the current nnir posted on:
ls6-ftp.cs.uni-dortmund.de:/pub/src/emacs
Not sure about FreeWais.  But a regexp search at 
http://ftpsearch.lycos.com/   (ftp search engine in Norway)
with something like "wais.*z$ should turn up several sources.

-- 
Harry Putnam <reader@newsguy.com>
Running Redhat Linux 5.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-24  3:31 ` Harry Putnam
@ 1999-01-24  5:59   ` Matt Pharr
  1999-01-24  6:37     ` Andrew J Cosgriff
                       ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Matt Pharr @ 1999-01-24  5:59 UTC (permalink / raw)



Harry Putnam <reader@newsguy.com> writes:
> Stefan Waldherr <stefan@waldherr.org> writes:
> > 
> > anyone knows of a search engine that lets me comfortably search my mail? For
> > some $#@#%^%@ reason, glimpse core dumps after 10 minutes of heavy indexing.
> 
> I suspect it would be well worth your while to try to get Glimpse
> working on your system.   Then get Kai's nnir package to use with it.

I've had similar problems with glimpse dumping core.  I ran it under
purify, which discovered an enormous number of memory reference problems,
though unfortunately the glimpse maintainers semmed befuddled by this
information.  "Someday" I hope to try to debug this a little bit further.
This problem is a bummer, since indeed nnir is quite nice.  BTW is nnir
going to be added to pgnus?

I sometimes have better luck if I remove the old glimpse index files and
just reindex, rather than trying to incrementally update my index.

> Admittedly, I am something of a novice, but I found the other main
> choice "FreeWais" to be hard as hell to install and learn to use.

It's too bad to hear that FreeWais doesn't sound promising.

-matt
-- 
Matt Pharr                                   mmp@graphics.stanford.edu
<URL:http://graphics.stanford.edu/~mmp>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-24  5:59   ` Matt Pharr
@ 1999-01-24  6:37     ` Andrew J Cosgriff
  1999-01-24  8:50     ` Stefan Waldherr
  1999-01-25 10:01     ` local search engine? (glimpse) Jari Aalto+list.ding
  2 siblings, 0 replies; 20+ messages in thread
From: Andrew J Cosgriff @ 1999-01-24  6:37 UTC (permalink / raw)



>>>>> "Matt" == Matt Pharr <mmp@Graphics.Stanford.EDU> writes:

Matt> Harry Putnam <reader@newsguy.com> writes:
>> Stefan Waldherr <stefan@waldherr.org> writes:
>> > 
>> > anyone knows of a search engine that lets me comfortably search
>> > my mail? For some $#@#%^%@ reason, glimpse core dumps after 10
>> > minutes of heavy indexing.
>> 
>> I suspect it would be well worth your while to try to get Glimpse
>> working on your system.   Then get Kai's nnir package to use with it.

Matt> I've had similar problems with glimpse dumping core.  I ran it
Matt> under purify, which discovered an enormous number of memory
Matt> reference problems, though unfortunately the glimpse maintainers
Matt> semmed befuddled by this information.  "Someday" I hope to try
Matt> to debug this a little bit further.  This problem is a bummer,
Matt> since indeed nnir is quite nice.  BTW is nnir going to be added
Matt> to pgnus?

http://rhodes.www.media.mit.edu/people/rhodes/remembrance.html

Is pretty cool too, although it didn't deal too well with the amount
of mail I wanted to index :P

-- 
Andrew J Cosgriff <ajc@bing.wattle.id.au> exterminate all rational thought !
                   smile lisp moon corporation phenylalanine
.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-24  5:59   ` Matt Pharr
  1999-01-24  6:37     ` Andrew J Cosgriff
@ 1999-01-24  8:50     ` Stefan Waldherr
  1999-01-24 21:05       ` Matt Pharr
  1999-01-25 10:01     ` local search engine? (glimpse) Jari Aalto+list.ding
  2 siblings, 1 reply; 20+ messages in thread
From: Stefan Waldherr @ 1999-01-24  8:50 UTC (permalink / raw)


>>>>> "Matt" == Matt Pharr <mmp@Graphics.Stanford.EDU> writes:

  Matt> I've had similar problems with glimpse dumping core.  I ran it under
  Matt> purify, which discovered an enormous number of memory reference
  Matt> problems, though unfortunately the glimpse maintainers semmed
  Matt> befuddled by this information.  "Someday" I hope to try to debug this

I agree, glimpse _is_ really nice. Especially with Kai's nnir interface. 

  Matt> I sometimes have better luck if I remove the old glimpse index files
  Matt> and just reindex, rather than trying to incrementally update my index.

Tried that, too. No luck.

  Matt> It's too bad to hear that FreeWais doesn't sound promising.

Tried that, too. Doesn't compile under Linux -- at least I didn't succeed in
make'ing it.

cu
Stefan.
-- 
Stefan Waldherr                   fax +49 431 8058 136
                               e-Mail stefan@waldherr.org
                                  www http://www.waldherr.org/


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-23 21:40 local search engine? Stefan Waldherr
  1999-01-24  3:31 ` Harry Putnam
@ 1999-01-24 17:58 ` Kai.Grossjohann
  1999-01-25 15:31   ` Harry Putnam
                     ` (2 more replies)
  1 sibling, 3 replies; 20+ messages in thread
From: Kai.Grossjohann @ 1999-01-24 17:58 UTC (permalink / raw)


It is very strange that you people have problems using freeWAIS-sf
(note the capitalization :-).  Though I might have an unfair advantage
in that one of the authors of the program is my friend which means I
know whom to ask for the setup.

If you have problems getting freeWAIS-sf to compile, mail me, I'll try
to help.  Same for configuring freeWAIS-sf to index your mail.

nnir.el doesn't work with mail backends other than nnml and nnmh.

kai
-- 
Abort this operation?   [Abort]  [Cancel]


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-24  8:50     ` Stefan Waldherr
@ 1999-01-24 21:05       ` Matt Pharr
  0 siblings, 0 replies; 20+ messages in thread
From: Matt Pharr @ 1999-01-24 21:05 UTC (permalink / raw)



Stefan Waldherr <stefan@waldherr.org> writes:
> >>>>> "Matt" == Matt Pharr <mmp@Graphics.Stanford.EDU> writes:
>   Matt> I sometimes have better luck if I remove the old glimpse index files
>   Matt> and just reindex, rather than trying to incrementally update my index.
> 
> Tried that, too. No luck.

One last thing to watch out for is that glimpse seems to be, uh,
particularly unrobust when one is low on disk space.  Some of the flakiness 
from glimpse that I was seeing disappeared when I started storing glimpse
files on a partition with tons of free space.

-matt
-- 
Matt Pharr                                   mmp@graphics.stanford.edu
<URL:http://graphics.stanford.edu/~mmp>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine? (glimpse)
  1999-01-24  5:59   ` Matt Pharr
  1999-01-24  6:37     ` Andrew J Cosgriff
  1999-01-24  8:50     ` Stefan Waldherr
@ 1999-01-25 10:01     ` Jari Aalto+list.ding
  2 siblings, 0 replies; 20+ messages in thread
From: Jari Aalto+list.ding @ 1999-01-25 10:01 UTC (permalink / raw)


* 1999-01-23 Matt Pharr <mmp@Graphics.Stanford.EDU> list.ding
| Harry Putnam <reader@newsguy.com> writes:
| > Stefan Waldherr <stefan@waldherr.org> writes:
| > > 
| > > anyone knows of a search engine that lets me comfortably search my mail? For
| > > some $#@#%^%@ reason, glimpse core dumps after 10 minutes of heavy indexing.
| > 
| > I suspect it would be well worth your while to try to get Glimpse
| > working on your system.   Then get Kai's nnir package to use with it.
| 
| I've had similar problems with glimpse dumping core.  I ran it under
| purify...

How much mail do you index? I Use HP-UX 10.20 and I guess I'm lucky to
not seeing glimpseindex to dump core yet.

    % glimpseindex -V
    This is glimpseindex version 4.0B1, 1996.

I have roughly 200 Meg mailing list and private mail that get indexed
by a cron job after active working hours. I use options:

        #       -z index compressed files
        #       -n include numbers
        #       -o build larger index
        #       -f incremental
        #       -b use even larger index (usefull for big files)
        #       -B use fast(big) hash table when indexing
        #       -M 10 use 10Meg memory

        -n -o -B -M 30

I use seprate directory wherei store the glimpse results (See -H option).
The disk has plenty of free space for working files.

jari



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-24 17:58 ` local search engine? Kai.Grossjohann
@ 1999-01-25 15:31   ` Harry Putnam
  1999-01-25 15:52     ` Kai.Grossjohann
  1999-01-26  5:25     ` Matt Simmons
  1999-01-27  7:59   ` Stefan Waldherr
  1999-01-28 18:18   ` Robert Epprecht
  2 siblings, 2 replies; 20+ messages in thread
From: Harry Putnam @ 1999-01-25 15:31 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE writes:

> It is very strange that you people have problems using freeWAIS-sf
> (note the capitalization :-).  Though I might have an unfair advantage
> in that one of the authors of the program is my friend which means I
> know whom to ask for the setup.

Not all of `us people' are sharp as razors on computer matters.  (he he)
Installing glimpse and agrep was easy enough, and learning to use
glimpse was not to bad either.  (I'm still finding ways to use
it... its quite versatile).

Compiling and installing freeWAIS-sf was also doable, once I caught on
to let the software use its defaults for nearly everything.  Learning
to use freeWAIS-sf has proven to be a harder nut to crack.  I've found
the documentation to  be hard to follow, and skimpy in important
areas.   Where as the Glimpse documentation seems thorough and useful.
I will be taking advantage of your kind offer in the near future.

> If you have problems getting freeWAIS-sf to compile, mail me, I'll try
> to help.  Same for configuring freeWAIS-sf to index your mail.
> 

There have been posts in the past suggesting that freeWAIS-sf was
considerably faster than "Glimpse", used with 'nnir'.  Can anyone
offer some documentation on that.  I mean just impressions etc not
serious benchmarks.

-- 
Harry Putnam <reader@newsguy.com>
Running Redhat Linux 5.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-25 15:31   ` Harry Putnam
@ 1999-01-25 15:52     ` Kai.Grossjohann
  1999-01-31  7:11       ` Julian Assange
  1999-01-26  5:25     ` Matt Simmons
  1 sibling, 1 reply; 20+ messages in thread
From: Kai.Grossjohann @ 1999-01-25 15:52 UTC (permalink / raw)


Harry Putnam <reader@newsguy.com> writes:

  > There have been posts in the past suggesting that freeWAIS-sf was
  > considerably faster than "Glimpse", used with 'nnir'.  Can anyone
  > offer some documentation on that.  I mean just impressions etc not
  > serious benchmarks.

For me, freeWAIS-sf queries take on the order of one or two seconds.
This is why, at first, I didn't notice the fact that nnir issues the
same query three times...  (This is on an UltraSparc running Solaris
2.5 on a local disk, not NFS mounted.)

You know the speed of Glimpse already.
kai
-- 
Abort this operation?   [Abort]  [Cancel]


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-26  5:25     ` Matt Simmons
@ 1999-01-26  5:23       ` Julian Assange
  0 siblings, 0 replies; 20+ messages in thread
From: Julian Assange @ 1999-01-26  5:23 UTC (permalink / raw)
  Cc: ding

> I used to use freeWAIS-sf, and have now switched back to glimpse.
> 
> Whereas searches with the small index took forever, searches with the
> medium index are only moderately slower than with freeWAIS.  For me,
> the moderate drop in speed more than makes up for the flakiness of
> freeWAIS.  I just got sick of indexes that never finished without
> dumping, queries that wouldn't run without dumping, etc etc
> 
> Matt

I switched TO freewais-sf for just these reasons. I was indexing
180Mb of mail, btw. Also, reading the glimpse source code left
me feeling truly ill.

Cheers,
Julian.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-25 15:31   ` Harry Putnam
  1999-01-25 15:52     ` Kai.Grossjohann
@ 1999-01-26  5:25     ` Matt Simmons
  1999-01-26  5:23       ` Julian Assange
  1 sibling, 1 reply; 20+ messages in thread
From: Matt Simmons @ 1999-01-26  5:25 UTC (permalink / raw)


I used to use freeWAIS-sf, and have now switched back to glimpse.

Whereas searches with the small index took forever, searches with the
medium index are only moderately slower than with freeWAIS.  For me,
the moderate drop in speed more than makes up for the flakiness of
freeWAIS.  I just got sick of indexes that never finished without
dumping, queries that wouldn't run without dumping, etc etc

Matt

-- 
     Matt Simmons  -  simmonmt@acm.org  -  http://www.netcom.com/~simmonmt
    Man does not live by words alone, despite the fact that sometimes he has
			to eat them.  --Adlai Stevenson


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-24 17:58 ` local search engine? Kai.Grossjohann
  1999-01-25 15:31   ` Harry Putnam
@ 1999-01-27  7:59   ` Stefan Waldherr
  1999-01-28 14:14     ` Kai.Grossjohann
  1999-01-28 18:18   ` Robert Epprecht
  2 siblings, 1 reply; 20+ messages in thread
From: Stefan Waldherr @ 1999-01-27  7:59 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

>>>>> "Kai" == Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

  Kai> If you have problems getting freeWAIS-sf to compile, mail me, I'll try
  Kai> to help.  Same for configuring freeWAIS-sf to index your mail.

Neato. Well, I think it maybe a good idea to do this on the mailing list. I'm
sure that others would be interested. Or not.

I tried to get the thing compiled from both the tar archive and a .src.rpm
(there is an alpha.rpm out there somewhere). If we get it to compile under my
i386 architecture, I'll build a rpm.

Let's see. uname yields

swa@amadeus:~/src/freeWAIS-sf-2.0.65> uname -a
Linux amadeus.waldherr.org 2.0.36 #1 Tue Oct 13 22:17:11 EDT 1998 i586 unknown

I run `./Configure -d' for a quick'n'dirty setup. Make'ing freeWAIS-sf stops
soon with


[-- Attachment #2: make-error --]
[-- Type: application/octet-stream, Size: 3640 bytes --]

swa@amadeus:~/src/freeWAIS-sf-2.0.65> make
make[1]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65'
Making all in ./ctype...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/ctype'
cc -c  -O   mkctype.c
In file included from mkctype.c:18:
../ir/cdialect.h:176: conflicting types for `strdup'
/usr/include/string.h:89: previous declaration of `strdup'
make[2]: *** [mkctype.o] Error 1
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/ctype'
Making all in ./regexp...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/regexp'
cc -c -I. -I../ctype -O   try.c
cc -c -I. -I../ctype -O   regexp.c
cc -c -I. -I../ctype -O   regerror.c
cc -c -I. -I../ctype -O   regsub.c
/bin/rm -f libregexp.a
ar rc libregexp.a regexp.o regerror.o regsub.o
: libregexp.a
/bin/rm -f try
if test -f try; then /bin/mv try try~; else exit 0; fi
cc -o try try.o  libregexp.a  -O  libregexp.a
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/regexp'
Making all in lib...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/lib'
/bin/rm -f trunc.o
cc -c -I. -I../ctype -O   trunc.c
/bin/rm -f trunc
if test -f trunc; then /bin/mv trunc trunc~; else exit 0; fi
cc -o trunc trunc.o  -O  
/bin/rm -f stringtoany.o
cc -c -I. -I../ctype -O   stringtoany.c
/bin/rm -f stringtoany
if test -f stringtoany; then /bin/mv stringtoany stringtoany~; else exit 0; fi
cc -o stringtoany stringtoany.o  -O  
/bin/rm -f ftwtest.o
cc -c -I. -I../ctype -O   ftwtest.c
In file included from ftwtest.c:5:
../ir/cdialect.h:176: conflicting types for `strdup'
/usr/include/string.h:89: previous declaration of `strdup'
make[2]: *** [ftwtest.o] Error 1
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/lib'
Making all in ir...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/ir'
make[2]: *** No rule to make target `../ctype/ctype.o', needed by `libwais.a'.  Stop.
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/ir'
Making all in ui...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/ui'
cc -c -I../ctype -I../ir -O   waisq.c
In file included from ../ir/cutil.h:59,
                 from wais.h:29,
                 from waisq.c:75:
../ir/cdialect.h:176: conflicting types for `strdup'
/usr/include/string.h:89: previous declaration of `strdup'
make[2]: *** [waisq.o] Error 1
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/ui'
Making all in bin...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/bin'
Nothing to make in "bin".
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/bin'
Making all in doc/original-TM-wais/manl...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/doc/original-TM-wais/manl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/doc/original-TM-wais/manl'
Making all in FIELD-EXAMPLE...
make[2]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/FIELD-EXAMPLE'
cd ../ir; make ../ir/waisindex
make[3]: Entering directory `/home/swa/src/freeWAIS-sf-2.0.65/ir'
cc -I../ctype  -lm  ../ir/waisindex.c   -o ../ir/waisindex
In file included from ../ir/cutil.h:59,
                 from ../ir/waisindex.c:240:
../ir/cdialect.h:176: conflicting types for `strdup'
/usr/include/string.h:89: previous declaration of `strdup'
make[3]: *** [../ir/waisindex] Error 1
make[3]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/ir'
make[2]: *** [../ir/waisindex] Error 2
make[2]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65/FIELD-EXAMPLE'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/home/swa/src/freeWAIS-sf-2.0.65'
make: *** [all] Error 2

[-- Attachment #3: Type: text/plain, Size: 39 bytes --]


This is probably related to the note


[-- Attachment #4: note --]
[-- Type: application/octet-stream, Size: 563 bytes --]

This version of freeWAIS-sf supports new proximity operators by Tom
Snee.  He also fixed the string search code.  You can now enable them
at the cost of dropping the string search capability. There is
currently no description of the proximity operators.  Have a look in
ir/query_l.l to learn about them.

Use proximity instead of string search? [n]  
 
remove() NOT found.
 
memcpy() NOT found.
 
scandir() NOT found.
 
strcspn() NOT found.
 
strdup() NOT found.
 
strerror() and sys_errlist[] NOT found.
 
syslog() not found in your C library--using ./syslog.c.

[-- Attachment #5: Type: text/plain, Size: 453 bytes --]


Has there been any re-organizing in string.h lately? Mine does include (among
others) strdup. 

Replacing the detected /usr/lib/libc.so with libc.so.6 didn't help much
(/usr/lib/libc.so is a script on RH systems).

Am I running into a known problem here?

Thanks,
Stefan.
-- 
Stefan Waldherr                   fax +49 431 8058 136
                               e-Mail stefan@waldherr.org
                                  www http://www.waldherr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-27  7:59   ` Stefan Waldherr
@ 1999-01-28 14:14     ` Kai.Grossjohann
  0 siblings, 0 replies; 20+ messages in thread
From: Kai.Grossjohann @ 1999-01-28 14:14 UTC (permalink / raw)


Stefan Waldherr <stefan@waldherr.org> writes:

  > Neato. Well, I think it maybe a good idea to do this on the
  > mailing list. I'm sure that others would be interested. Or not.

Eek.  I have now tried to get freeWAIS-sf 2.0.65 as well as 2.2.10 to
compile on a SuSE 6.0 system, with the same problems you describe.
(The early symptoms are different for the systems, but ultimately the
result is the same.)

It appears that a lot of twiddling in config.sh with the d_strdup
variable and other similar variables will do the trick, but of course
Configure should be able to do it all by itself.  Hm.  I have now
contacted our local freeWAIS-sf guru and have made an appointment with
him for friday week.

More later.

kai
-- 
Abort this operation?   [Abort]  [Cancel]


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-24 17:58 ` local search engine? Kai.Grossjohann
  1999-01-25 15:31   ` Harry Putnam
  1999-01-27  7:59   ` Stefan Waldherr
@ 1999-01-28 18:18   ` Robert Epprecht
  1999-01-29 17:53     ` Kai.Grossjohann
  2 siblings, 1 reply; 20+ messages in thread
From: Robert Epprecht @ 1999-01-28 18:18 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE writes:

> nnir.el doesn't work with mail backends other than nnml and nnmh.

Do you intend to make it work with nnfolder?

Robert Epprecht



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-28 18:18   ` Robert Epprecht
@ 1999-01-29 17:53     ` Kai.Grossjohann
  0 siblings, 0 replies; 20+ messages in thread
From: Kai.Grossjohann @ 1999-01-29 17:53 UTC (permalink / raw)


Robert Epprecht <epprecht@logon.ch> writes:

  > Kai.Grossjohann@CS.Uni-Dortmund.DE writes:
  > 
  > > nnir.el doesn't work with mail backends other than nnml and nnmh.
  > 
  > Do you intend to make it work with nnfolder?

I intend to, but as I don't use nnfolder I can't promise that I'll get
to it.  If somebody is willing to help, however...

What I need is the group name and article number.  I.e. you would need
to find a way to use Glimpse or freeWAIS-sf for indexing the nnfolder
files and, when a search is started, return the file name and article
number.

I think the article number is stored in the nnfolder file as the
X-Gnus-Article-Number header or something like that.  In order to get
freeWAIS-sf to print it in a retrieval result, the *.fmt file needs to
specify this header as part of the headline.  Dunno what to do about
Glimpse.

kai
-- 
Abort this operation?   [Abort]  [Cancel]


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-25 15:52     ` Kai.Grossjohann
@ 1999-01-31  7:11       ` Julian Assange
  1999-01-31 12:02         ` Kai.Grossjohann
  1999-03-16 16:10         ` Kai.Grossjohann
  0 siblings, 2 replies; 20+ messages in thread
From: Julian Assange @ 1999-01-31  7:11 UTC (permalink / raw)
  Cc: ding

Kai.Grossjohann@CS.Uni-Dortmund.DE writes:

> Harry Putnam <reader@newsguy.com> writes:
> 
>   > There have been posts in the past suggesting that freeWAIS-sf was
>   > considerably faster than "Glimpse", used with 'nnir'.  Can anyone
>   > offer some documentation on that.  I mean just impressions etc not
>   > serious benchmarks.
> 
> For me, freeWAIS-sf queries take on the order of one or two seconds.
> This is why, at first, I didn't notice the fact that nnir issues the
> same query three times...  (This is on an UltraSparc running Solaris
> 2.5 on a local disk, not NFS mounted.)

I wrote a query cache to deal with the same-query-three-times problem.

Cheers,
Julian.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-31  7:11       ` Julian Assange
@ 1999-01-31 12:02         ` Kai.Grossjohann
  1999-02-01  1:25           ` Julian Assange
  1999-03-16 16:10         ` Kai.Grossjohann
  1 sibling, 1 reply; 20+ messages in thread
From: Kai.Grossjohann @ 1999-01-31 12:02 UTC (permalink / raw)


Julian Assange <proff@iq.org> writes:

  > I wrote a query cache to deal with the same-query-three-times problem.

Does the cache in the most current version of nnir work, as well?  If
it doesn't, I'd be interested in your code.

nnir can be had from ls6-ftp.cs.uni-dortmund.de:/pub/src/emacs.

kai
-- 
Abort this operation?   [Abort]  [Cancel]


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-31 12:02         ` Kai.Grossjohann
@ 1999-02-01  1:25           ` Julian Assange
  0 siblings, 0 replies; 20+ messages in thread
From: Julian Assange @ 1999-02-01  1:25 UTC (permalink / raw)
  Cc: ding

Kai.Grossjohann@CS.Uni-Dortmund.DE writes:

> Julian Assange <proff@iq.org> writes:
> 
>   > I wrote a query cache to deal with the same-query-three-times problem.
> 
> Does the cache in the most current version of nnir work, as well?  If
> it doesn't, I'd be interested in your code.
> 
> nnir can be had from ls6-ftp.cs.uni-dortmund.de:/pub/src/emacs.

The cache code is trivial. Search for `cache'.

Cheers,
Julian.

;;; nnir.el --- search mail with various search engines
;; Copyright (C) 1998 Kai Großjohann

;; $Id: nnir.el,v 1.29 1998/09/23 08:48:54 grossjoh Exp $

;; Author: Kai Großjohann <grossjohann@ls6.cs.uni-dortmund.de>
;; Keywords: news, mail, searching, ir, glimpse, wais 

;; This file is not part of GNU Emacs.

;; This is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;; Commentary:

;; This code is still in the development stage but I'd like other
;; people to have a look at it.  Please do not hesitate to contact me
;; with your ideas.

;; What does it do?  Well, it allows you to index your mail using some
;; search engine (freeWAIS-sf and Glimpse are currently supported),
;; then type `G G' in the Group buffer and issue a query to the search
;; engine.  You will then get a buffer which shows all articles
;; matching the query, sorted by Retrieval Status Value (score).

;; When looking at the retrieval result (in the Summary buffer) you
;; can type `G T' (aka M-x gnus-summary-nnir-goto-thread RET) on an
;; article.  You will be teleported into the group this article came
;; from, showing the thread this article is part of.  (See below for
;; restrictions.)

;; The Lisp installation is simple: just put this file on your
;; load-path, byte-compile it, and load it from ~/.gnus or something.
;; This will install a new command `G G' in your Group buffer for
;; searching your mail.

;; Restrictions:
;;
;; * Currently, this expects that you use nnml or another
;;   one-file-per-message backend.
;; * It can only search one mail backend.
;; * There are restrictions to the Glimpse setup.
;; * There are restrictions to the Wais setup.
;; * gnus-summary-nnir-goto-thread: Fetches whole group first, before
;;   limiting to the right articles.  This is much too slow, of
;;   course.  May issue a query for number of articles to fetch; you
;;   must accept the default of all articles at this point or things
;;   may break.

;; The Lisp setup involves setting a few variables and setting up the
;; search engine.  The first variable to set is `nnir-mail-backend'.
;; For me, `gnus-secondary-select-methods' contains just one select
;; method, and this is also what I put in `nnir-mail-backend'.  The
;; second variable to set is `nnir-search-engine'.  Choose one of the
;; engines listed in `nnir-engines'.

;; You must also set up a search engine.  I'll tell you about the two
;; search engines currently supported:

;; 1. freeWAIS-sf
;;
;; As always with freeWAIS-sf, you need a so-called `format file'.  I
;; use the following file:
;;
;; ,-----
;; | # Kai's format file for freeWAIS-sf for indexing mails.
;; | # Each mail is in a file, much like the MH format.
;; |                                         
;; | # Document separator should never match -- each file is a document.
;; | record-sep: /^@this regex should never match@$/
;; |                                         
;; | # Searchable fields specification.      
;; |                                         
;; | region: /^[sS]ubject:/ /^[sS]ubject: */ 
;; |         subject "Subject header" stemming TEXT BOTH
;; | end: /^[^ \t]/                          
;; |                                         
;; | region: /^([tT][oO]|[cC][cC]):/ /^([tT][oO]|[cC][cC]): */
;; |         to "To and Cc headers" stemming SOUNDEX BOTH
;; | end: /^[^ \t]/                          
;; |                                         
;; | region: /^[fF][rR][oO][mM]:/ /^[fF][rR][oO][mM]: */
;; |         from "From header" stemming SOUNDEX BOTH
;; | end: /^[^ \t]/                          
;; |                                         
;; | region: /^$/                            
;; |         stemming TEXT GLOBAL            
;; | end: /^@this regex should never match@$/
;; `-----
;;
;; 1998-07-22: waisindex would dump core on me for large articles with
;; the above settings.  I used /^$/ as the end regex for the global
;; field.  That seemed to work okay.

;; As more recent versions of freeWAIS-sf come with a nifty tool
;; called `makedb', I use that.  Here's my `makedb.conf':
;;
;; ,-----
;; | # Config file for makedb
;; | 
;; | # Global options
;; | waisindex = /usr/local/bin/waisindex
;; | wais_opt  = -t fields
;; | 
;; | # Own variables
;; | homedir = /home/kai
;; | 
;; | # The mail database.
;; | database        = mail
;; | files           = `find $homedir/Mail -name \*[0-9] -print`
;; | dbdir           = $homedir/.wais
;; | limit           = 100
;; `-----
;;
;; The Lisp setup involves the `nnir-wais-*' variables.  The most
;; difficult to understand variable is probably
;; `nnir-wais-remove-prefix'.  Here's what it does: the output of
;; `waissearch' basically contains the file name and the (full)
;; directory name.  As Gnus works with group names rather than
;; directory names, the directory name is transformed into a group
;; name as follows: first, a prefix is removed from the (full)
;; directory name, then all `/' are replaced with `.'.  The variable
;; `nnir-wais-remove-prefix' should contain a regex matching exactly
;; this prefix.  It defaults to `$HOME/Mail/' (note the trailing
;; slash).

;; 2. Glimpse
;;
;; The code expects you to have one Glimpse index which contains all
;; your mail files.  The Lisp setup involves setting the
;; `nnir-glimpse-*' variables.  The most difficult to understand
;; variable is probably `nnir-glimpse-remove-prefix', it corresponds
;; to `nnir-wais-remove-prefix', see above.  The `nnir-glimpse-home'
;; variable should be set to the value of the `-H' option which allows
;; one to search this Glimpse index.  I have indexed my whole home
;; directory with Glimpse, so I assume a default of `$HOME'.

;; Developer information:

;; I have tried to make the code expandable.  Basically, it is divided
;; into two layers.  The upper layer is somewhat like the `nnvirtual'
;; or `nnkiboze' backends: given a specification of what articles to
;; show from another backend, it creates a group containing exactly
;; those articles.  The lower layer issues a query to a search engine
;; and produces such a specification of what articles to show from the
;; other backend.

;; The interface between the two layers consists of the single
;; function `nnir-run-query', which just selects the appropriate
;; function for the search engine one is using.  The input to
;; `nnir-run-query' is a string, representing the query as input by
;; the user.  The output of `nnir-run-query' is supposed to be a
;; vector, each element of which should in turn be a three-element
;; vector.  The first element should be group name of the article, the
;; second element should be the article number, and the third element
;; should be the Retrieval Status Value (RSV) as returned from the
;; search engine.  An RSV is the score assigned to the document by the
;; search engine.  For Boolean search engines like Glimpse, the RSV is
;; always 1000 (or 1 or 100, or whatever you like).

;; The sorting order of the articles in the summary buffer created by
;; nnir is based on the order of the articles in the above mentioned
;; vector, so that's where you can do the sorting you'd like.  Maybe
;; it would be nice to have a way of displaying the search result
;; sorted differently?

;; So what do you need to do when you want to add another search
;; engine?  You write a function that executes the query.  Temporary
;; data from the search engine can be put in `nnir-tmp-buffer'.  This
;; function should return the list of articles as a vector, as
;; described above.  Then, you need to register this backend in
;; `nnir-engines'.  Then, users can choose the backend by setting
;; `nnir-search-engine'.

;; Todo, or future ideas:

;; * Make it so that Glimpse can also be called without `-F'.
;;
;; * It should be possible to restrict search to certain groups.
;;
;; * There is currently no error checking.
;;
;; * The summary buffer display is currently really ugly, with all the
;;   added information in the subjects.  How could I make this
;;   prettier?
;;
;; * A function which can be called from an nnir summary buffer which
;;   teleports you into the group the current article came from and
;;   shows you the whole thread this article is part of.
;;   Implementation suggestions?
;;   (1998-07-24: There is now a preliminary implementation, but
;;   it is much too slow and quite fragile.)
;;
;; * Support other mail backends.  In particular, probably quite a few
;;   people use nnfolder.  How would one go about searching nnfolders
;;   and producing the right data needed?  The group name and the RSV
;;   are simple, but what about the article number?
;;
;; * Support compressed mail files.  Probably, just stripping off the
;;   `.gz' or `.Z' file name extension is sufficient.
;;
;; * Support a find/grep combination.
;;

;; Have you got other ideas?

;;; Setup Code:

(defconst nnir-version "$Id: nnir.el,v 1.29 1998/09/23 08:48:54 grossjoh Exp $"
  "Version of NNIR.")

(require 'cl)
(require 'nnoo)

(nnoo-declare nnir)
(nnoo-define-skeleton nnir)
(nnoo-define-basics nnir)

(gnus-declare-backend "nnir" 'mail)

;;; User Customizable Variables:

;; Mail backend.

(defvoo nnir-mail-backend '(nnml "private"))

;; Search engine to use.

(defvoo nnir-search-engine 'wais
  "The search engine to use.  Must be a symbol.
See `nnir-engines' for a list of supported engines.")

;; Glimpse engine.

(defvoo nnir-glimpse-program "glimpse"
  "Name of Glimpse executable.")

(defvoo nnir-glimpse-home (getenv "HOME")
  "Value of `-H' glimpse option.
`~' and environment variables must be expanded, see the functions
`expand-file-name' and `substitute-in-file-name'.")

(defvoo nnir-glimpse-remove-prefix (concat (getenv "HOME") "/Mail/")
  "The prefix to remove from each file name returned by Glimpse
in order to get a group name (albeit with / instead of .).")

;; freeWAIS-sf.

(defvoo nnir-wais-program "wais"
  "Name of waissearch executable.")

(defvoo nnir-wais-database (expand-file-name "~/.wais/mail")
  "Name of Wais database containing the mail.")

(defvoo nnir-wais-remove-prefix (concat (getenv "HOME") "/Mail/")
  "The prefix to remove from each directory name returned by waissearch
in order to get a group name (albeit with / instead of .).")

;;; Internal Variables:

(defvoo nnir-engines
    '((glimpse . nnir-run-glimpse)
      (wais    . nnir-run-waissearch)
      (imap    . nnir-run-imap))
  "Alist of supported search engines.
The car is a symbol designating the engine, the cdr is name of function
that does the search.  Add an entry here when adding a new search engine.")

(defvoo nnir-current-query nil
  "Internal: stores current query (= group name).")

(defvoo nnir-artlist nil
  "Internal: stores search result.")

(defvoo nnir-tmp-buffer "*nnir*"
  "Internal: temprary buffer.")

;;; Code:

;; Gnus glue.

(defun gnus-group-make-nnir-group (query)
  (interactive "sQuery: ")
  (gnus-group-read-ephemeral-group query '(nnir "") t nil nil))

;; Emacs 19 compatibility?
(or (fboundp 'kbd) (defalias 'kbd 'read-kbd-macro))

(defun nnir-group-mode-hook ()
  (define-key gnus-group-mode-map
    (if (fboundp 'read-kbd-macro)
        (kbd "G G")
      "GG")                             ; XEmacs 19 compat
    'gnus-group-make-nnir-group))
(add-hook 'gnus-group-mode-hook 'nnir-group-mode-hook)



;; Summary mode commands.

(defun gnus-summary-nnir-goto-thread ()
  "Only applies to nnir groups.  Go to group this article came from
and show thread that contains this article."
  (interactive)
  (unless (eq 'nnir (car (gnus-find-method-for-group gnus-newsgroup-name)))
    (error "Can't execute this command unless in nnir group."))
  (let* ((cur (cdr gnus-article-current))
         (backend-group (nnir-artlist-artitem-group nnir-artlist cur))
         (backend-number (nnir-artlist-artitem-number nnir-artlist cur)))
    (gnus-group-read-ephemeral-group
     backend-group
     nnir-mail-backend
     t                                  ; activate
     (cons (current-buffer)
           'summary)                    ; window config
     nil
     (list backend-number))
    (gnus-summary-limit (list backend-number))
    (gnus-summary-refer-thread)))

(if (fboundp 'eval-after-load)
    (eval-after-load "gnus-sum"
      '(define-key gnus-summary-goto-map
         "T" 'gnus-summary-nnir-goto-thread))
  (add-hook 'gnus-summary-mode-hook
            (function (lambda ()
                        (define-key gnus-summary-goto-map
                          "T" 'gnus-summary-nnir-goto-thread)))))



;; Gnus backend interface functions.

(deffoo nnir-open-server (server &optional definitions)
  ;; Just set the server variables appropriately.
  (nnoo-change-server 'nnir server definitions))

(deffoo nnir-request-group (group &optional server fast)
  "GROUP is the query string."
  (nnir-possibly-change-server server)
  (setq nnir-artlist (nnir-run-query group))
  (save-excursion
    (set-buffer nntp-server-buffer)
    (if (zerop (length nnir-artlist))
        (nnheader-report 'nnir "Search produced empty results.")
      (nnheader-insert "211 %d %d %d %s\n"
                       (nnir-artlist-length nnir-artlist) ; total #
                       1                                  ; first #
                       (nnir-artlist-length nnir-artlist) ; last #
                       group))))                          ; group name

(deffoo nnir-retrieve-headers (articles &optional group server fetch-old)
  (save-excursion
    (let ((artlist (copy-sequence articles))
          (idx 1)
          (art nil)
          (artitem nil)
          (artgroup nil) (artno nil)
          (artrsv nil)
          (artfullgroup nil)
          (novitem nil)
          (novdata nil)
          (foo nil))
      (while (not (null artlist))
        (setq art (car artlist))
        (or (numberp art)
            (nnheader-report
             "nnglimpse-retrieve-headers doesn't grok message ids: %s"
             art))
        (setq artitem (nnir-artlist-article nnir-artlist art))
        (setq artrsv (nnir-artitem-rsv artitem))
        (setq artgroup (nnir-artitem-group artitem))
        (setq artno (nnir-artitem-number artitem))
        (setq artfullgroup (nnir-group-full-name artgroup))
        ;; retrieve NOV or HEAD data for this article, transform into
        ;; NOV data and prepend to `novdata'
        (set-buffer nntp-server-buffer)
        (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil))
          (nov
           (goto-char (point-min))
           (setq novitem (nnheader-parse-nov)))
          (headers
           (goto-char (point-min))
           (setq novitem (nnheader-parse-head)))
          (t (nnheader-report "Don't support header type %s." foo)))
        ;; replace article number in original group with article number
        ;; in nnglimpse group
        (mail-header-set-number novitem idx)
        (mail-header-set-from novitem
                              (mail-header-from novitem))
        (mail-header-set-subject
         novitem
         (format "[%d: %s/%d] %s"
                 artrsv artgroup artno
                 (mail-header-subject novitem)))
        (push novitem novdata)
        (setq artlist (cdr artlist))
        (setq idx (1+ idx)))
      (setq novdata (nreverse novdata))
      (set-buffer nntp-server-buffer) (erase-buffer)
      (mapcar 'nnheader-insert-nov novdata)
      'nov)))

(deffoo nnir-request-article (article
                              &optional group server to-buffer)
  (save-excursion
    (let* ((artitem (nnir-artlist-article nnir-artlist
                                          article))
           (artgroup (nnir-artitem-group artitem))
           (artno (nnir-artitem-number artitem))
           ;; Bug?
           ;; Why must we bind nntp-server-buffer here?  It won't
           ;; work if `buf' is used, say.  (Of course, the set-buffer
           ;; line below must then be updated, too.)
           (nntp-server-buffer (or to-buffer nntp-server-buffer)))
      (set-buffer nntp-server-buffer)
      (erase-buffer)
      (message "Requesting article %d from group %s"
               artno
               (nnir-group-full-name artgroup))
      (gnus-request-article artno (nnir-group-full-name artgroup)
                            nntp-server-buffer)
      (cons artgroup artno))))



;;; Search Engine Interfaces:

;; Glimpse interface.
(defun nnir-run-glimpse (query)
  "Run given query against glimpse.  Returns a vector of (group name, file name)
pairs (also vectors, actually)."
  (save-excursion
    (let ((artlist nil))
      (setq nnir-current-query query)
      (set-buffer (get-buffer-create nnir-tmp-buffer))
      (erase-buffer)
      (message "Doing glimpse query %s..." query)
      (let ((exitstatus
             (call-process nnir-glimpse-program
                           nil             ; input from /dev/null
                           t               ; output
                           nil             ; don't redisplay
                           "-H" nnir-glimpse-home ; search home dir
                           "-W"            ; match pattern in file
                           "-i" "-l" "-y"  ; misc options
                           "-F" nnir-glimpse-remove-prefix ; only mail files
                           query           ; the query, in glimpse format
                           )))
        (unless (or (null exitstatus)
                    (zerop exitstatus))
          (nnheader-report "Couldn't run glimpse: %s" exitstatus)
          ;; Glimpse failure reason is in this buffer, show it if
          ;; the user wants it.
          (when (> gnus-verbose 6)
            (display-buffer nnir-tmp-buffer))))
      (message "Doing glimpse query %s...done" query)
      (sit-for 0)
      ;; CCC: The following work of extracting group name and article
      ;; number from the Glimpse output can probably better be done by
      ;; just going through the buffer once, and plucking out the
      ;; right information from each line.
      ;; remove superfluous stuff from glimpse output
      (goto-char (point-min))
      (delete-non-matching-lines "/[0-9]+$")
      ;;(delete-matching-lines "\\.overview~?$")
      (goto-char (point-min))
      (while (re-search-forward (concat "^" nnir-glimpse-remove-prefix) nil t)
        (replace-match ""))
      ;; separate group name from article number with \t
      ;; XEmacs compatible version
      (goto-char (point-max))
      (while (re-search-backward "/[0-9]+$" nil t)
        (delete-char 1 nil)
        (insert-char ?\t 1))
; Emacs compatible version
;      (goto-char (point-min))
;      (while (re-search-forward "\\(/\\)[0-9]+$" nil t)
;        (replace-match "\t" t t nil 1))
      ;; replace / with . in group names
      (subst-char-in-region (point-min) (point-max) ?/ ?. t)
      ;; massage buffer to contain some Lisp;
      ;; this depends on the artlist encoding internals
      ;; maybe this dependency should be removed?
      (goto-char (point-min))
      (while (not (eobp))
        (insert "[\"")
        (skip-chars-forward "^\t")
        (insert "\" ")
        (end-of-line)
        (insert " 1000 ]")              ; 1000 = score
        (forward-line 1))
      (insert "])\n")
      (goto-char (point-min))
      (insert "(setq artlist [\n")
      (eval-buffer)
      (sort* artlist
             (function (lambda (x y)
                         (if (string-lessp (nnir-artitem-group x)
                                           (nnir-artitem-group y))
                             t
                           (< (nnir-artitem-number x)
                              (nnir-artitem-number y))))))
      )))

(defvoo nnir-wais-cache-list nil)
(defvoo nnir-wais-cache-query nil)

;; freeWAIS-sf interface.
(defun nnir-run-waissearch (query)
  "Run given query agains waissearch.  Returns vector of (group name, file name)
pairs (also vectors, actually)."
  (if (string= nnir-wais-cache-query query)
      nnir-wais-cache-list
    (save-excursion
      (let ((artlist nil)
	    (score nil) (artno nil) (dirnam nil) (group nil))
	(setq nnir-current-query query)
	(set-buffer (get-buffer-create nnir-tmp-buffer))
	(erase-buffer)
	(message "Doing WAIS query %s..." query)
	(call-process nnir-wais-program
		      nil                 ; input from /dev/null
		      t                   ; output to current buffer
		      nil                 ; don't redisplay
		      "-d" nnir-wais-database ; database to search
		      query)
	(message "Massaging waissearch output...")
	;; remove superfluous lines
	(keep-lines "Score:")
	;; extract data from result lines
	(goto-char (point-min))
	(while (re-search-forward
		"Score: +\\([0-9]+\\).*'\\([0-9]+\\) +\\([^']+\\)/'" nil t)
	  (setq score (match-string 1)
		artno (match-string 2)
		dirnam (match-string 3))
	  (unless (string-match nnir-wais-remove-prefix dirnam)
	    (nnheader-report 'nnir "Dir name %s doesn't contain prefix %s"
			     dirnam nnir-wais-remove-prefix))
	  (setq group (substitute ?. ?/ (replace-match "" t t dirnam)))
	  (push (vector group
			(string-to-int artno)
			(string-to-int score))
              artlist))
	(message "Massaging waissearch output...done")
	(setq nnir-wais-cache-query query)
	(setq nnir-wais-cache-list
	      (apply 'vector
		     (sort* artlist
			    (function (lambda (x y)
					(> (nnir-artitem-rsv x)
					   (nnir-artitem-rsv y)))))))))))
  
;; IMAP interface.  The following function is Copyright (C) 1998 Simon
;; Josefsson <jas@pdc.kth.se>.
;; todo:
;; it does the same search three (3) times???!
;; we should not use nnimap at all but open our own server connection
;; we should not LIST * but use nnimap-list-pattern from defs
;; utf7 encode queries
;; handle errors
(defun nnir-run-imap (query)
  (require 'imap4rev1)
  (require 'nnimap)
  (save-excursion
    (let ((server (cadr nnir-mail-backend))
         (defs (caddr nnir-mail-backend)))
      (message "Opening server %s" server)
      (when (nnimap-open-server server defs) ;; xxx
       (let ((artlist nil)
             (buf nnimap-server-buffer)) ;; xxx
         (message "Fetching mailbox list from %s" server)
         (imap-send-command-wait "LIST \"\" *" buf) ;; xxx
         (message "Searching mailboxes...")
         (mapatoms (lambda (sym)
                     (let ((group (symbol-name sym))
                           (arts 0))
                       (setq imap-current-folder group)
                       (imap-send-command-wait (format "SELECT %s" group) buf)
                       (imap-send-command-wait (format "UID SEARCH TEXT %s"
                                                       query) buf)
                       (mapcar (lambda (artnum)
                                 (push (vector group artnum 1) artlist)
                                 (setq arts (1+ arts)))
                               (imap-folder-get 'search nil buf))
                       (message "%d matching articles in mailbox %s"
                                arts group)))
                   (with-current-buffer buf imap-data-folder))
         (message "Searching mailboxes...done")
        (reverse artlist))))))


;;; Util Code:

(defun nnir-run-query (query)
  "Invoke appropriate search engine function (see `nnir-engines')."
  (funcall (cdr (assoc nnir-search-engine nnir-engines))
           query))

(defun nnir-group-full-name (shortname)
  "For the given group name, return a full Gnus group name.
The Gnus backend/server information is added."
  (gnus-group-prefixed-name shortname nnir-mail-backend))

(defun nnir-possibly-change-server (server)
  (unless (and server (nnir-server-opened server))
    (nnir-open-server server)))


;; Data type article list.

(defun nnir-artlist-length (artlist)
  "Returns number of articles in artlist."
  (length artlist))

(defun nnir-artlist-article (artlist n)
  "Returns from ARTLIST the Nth artitem (counting starting at 1)."
  (elt artlist (1- n)))

(defun nnir-artitem-group (artitem)
  "Returns the group from the ARTITEM."
  (elt artitem 0))

(defun nnir-artlist-artitem-group (artlist n)
  "Returns from ARTLIST the group of the Nth artitem (counting from 1)."
  (nnir-artitem-group (nnir-artlist-article artlist n)))

(defun nnir-artitem-number (artitem)
  "Returns the number from the ARTITEM."
  (elt artitem 1))

(defun nnir-artlist-artitem-number (artlist n)
  "Returns from ARTLIST the number of the Nth artitem (counting from 1)."
  (nnir-artitem-number (nnir-artlist-article artlist n)))

(defun nnir-artitem-rsv (artitem)
  "Returns the Retrieval Status Value (RSV, score) from the ARTITEM."
  (elt artitem 2))

(defun nnir-artlist-artitem-rsv (artlist n)
  "Returns from ARTLIST the Retrieval Status Value of the Nth artitem
(counting from 1)."
  (nnir-artitem-rsv (nnir-artlist-article artlist n)))

;; unused?
(defun nnir-artlist-groups (artlist)
  "Returns a list of all groups in the given ARTLIST."
  (let ((res nil)
        (with-dups nil))
    ;; from each artitem, extract group component
    (setq with-dups (mapcar 'nnir-artitem-group artlist))
    ;; remove duplicates from above
    (mapcar (function (lambda (x) (add-to-list 'res x)))
            with-dups)
    res))


;; The end.
(provide 'nnir)


-- 
Nixon, pull out like your father should have.
     - Graffiti on Richard Nixon


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: local search engine?
  1999-01-31  7:11       ` Julian Assange
  1999-01-31 12:02         ` Kai.Grossjohann
@ 1999-03-16 16:10         ` Kai.Grossjohann
  1 sibling, 0 replies; 20+ messages in thread
From: Kai.Grossjohann @ 1999-03-16 16:10 UTC (permalink / raw)
  Cc: ding

Julian Assange <proff@iq.org> writes:

  > I wrote a query cache to deal with the same-query-three-times problem.

The current version of nnir.el (1.42, available from
ftp://ls6-ftp.cs.uni-dortmund.de/pub/src/emacs) ought to include a
cache.  Please tell me if it doesn't work.

kai
-- 
I like _\bb_\bo_\bt_\bh kinds of music.


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~1999-03-16 16:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-23 21:40 local search engine? Stefan Waldherr
1999-01-24  3:31 ` Harry Putnam
1999-01-24  5:59   ` Matt Pharr
1999-01-24  6:37     ` Andrew J Cosgriff
1999-01-24  8:50     ` Stefan Waldherr
1999-01-24 21:05       ` Matt Pharr
1999-01-25 10:01     ` local search engine? (glimpse) Jari Aalto+list.ding
1999-01-24 17:58 ` local search engine? Kai.Grossjohann
1999-01-25 15:31   ` Harry Putnam
1999-01-25 15:52     ` Kai.Grossjohann
1999-01-31  7:11       ` Julian Assange
1999-01-31 12:02         ` Kai.Grossjohann
1999-02-01  1:25           ` Julian Assange
1999-03-16 16:10         ` Kai.Grossjohann
1999-01-26  5:25     ` Matt Simmons
1999-01-26  5:23       ` Julian Assange
1999-01-27  7:59   ` Stefan Waldherr
1999-01-28 14:14     ` Kai.Grossjohann
1999-01-28 18:18   ` Robert Epprecht
1999-01-29 17:53     ` Kai.Grossjohann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).