Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for [[/eggref/4/estraier|the CHICKEN 4 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-4.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags:eggs search]] [[toc:]] == estraier == Introduction The Estraier Chicken [[eggs|egg]] is a thin wrapper around the [[http://hyperestraier.sourceforge.net/|Hyper Estraier]] [[http://hyperestraier.sourceforge.net/pguide-en.html|API]]. == Examples === Indexing a document The following code receives a path to a Estraier DB and a file and adds it to the DB: <enscript highlight=scheme>(use estraier) (define (estraier-update-document path-db path-text) (let ((doc (est-doc-new))) ; Here you could use an HTTP URL if your file is visible somewhere: (est-doc-add-attr doc "@uri" path-text) ; You will want to set the title to something more meaningful: (est-doc-add-attr doc "@title" path-text) (with-input-from-file path-text (lambda () (let loop ((line (read-line))) (unless (eof-object? line) ; If your file is not in Unicode, use the iconv egg to convert ; the charset of the lines to Unicode. (est-doc-add-text doc line) (loop (read-line)))))) (let ((db (est-db-open path-db (bitwise-ior *estdbwriter* *estdbcreat*)))) (est-db-put-doc db doc *estpdclean*) (est-db-close db)))) </enscript> === Searching for documents <enscript highlight=scheme>(use estraier) (define (estraier-search path-data query) (let ((condition (est-cond-new))) (est-cond-set-phrase condition query) (let* ((db (est-db-open (svnwiki-make-pathname path-data "estraier-db") 0)) (hints (cbmapopenex 32)) (results (vector->list (est-db-search db condition hints))) (words (est-hints-to-words hints))) (map (lambda (id) (let ((doc (est-db-get-doc db id 0))) (list (est-doc-attr doc "@uri") (est-doc-attr doc "@title") (est-doc-make-snippet doc words 480 96 96)))) results)))) </enscript> == Authors This egg is made by [[http://azul.freaks-unidos.net/|Alejandro Forero Cuervo]] <azul@freaks-unidos.net>. == License The {{estraier}} egg is available under the GNU General Public License. == Requirements In order to build this egg you'll need to have Hyper Estraier and libQDBM. Note that you'll need the development packages for both. === Debian In Debian, it suffices to install packages {{libestraier-dev}} and {{libqdbm-dev}}. The dependencies will take care of the rest. As of this writing, Hyper Estraier is not available in Debian stable. You'll have to use testing.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 5 by 1?