--- trunk/README.pod 2006/05/09 22:55:42 51 +++ trunk/README.pod 2006/05/11 10:19:46 54 @@ -23,8 +23,7 @@ =item * -Hyper Estraier (tested with 0.5.0-1.0.0+, version newer than 0.9.6 are -recommended) +Hyper Estraier (tested with various versions, recommended 1.2.4 of newer) =back @@ -38,7 +37,7 @@ =item * -perl modules C, C, C and optionally C +perl modules C, C, C and optionally C =item * @@ -62,66 +61,34 @@ install C shared library in system-wide location so that PostgreSQL could access it. -Next, you will have to create test index. You have two options: +=head2 Create sample index using Hyper Estraier perl bindings -=head2 Create index using estcmd +Perl bindings for Hyper Estraier are available at CPAN: -This will create temporary files on disk and index them using estcmd gather +L - cd data - make index - cd .. -B this method is incomplete and won't create node index needed -to run last examples in C correctly. Solution is simple: either -symlink your newly created index to Hyper Estraier C<_node> directory or -create node and fill re-create index using C. - -=head2 Create index using Hyper Estraier perl bindings - -Perl bindings for Hyper Estraier are available at - -L - -However, they don't support node API (yet), so you will have to use -my modified version which is available at -L in C repository. - -If you installed bindings as documented in README file, you can use -perl binding to create index about three times faster than using C -(to be fair, I must say that creation of intermediate files take most time, -not indexing). - -However, you will first need to create node I using Hyper Estraier's -administration interface at L. You will also -need user C with password C because those values are -hard-coded in C. If you want to use different user on index -name, feel free to change script. +After installing C you can create index using following commands: cd data - make perl + make index cd .. To run tests (which require that you have estcmd in your $PATH) issue make test -See also included file test.sql for more examples of usage. +See also included file C for more examples of usage. =head1 Usage of pgest from SQL -C PostgreSQL function has two different prototypes (number of arguments) depending on usage. +C PostgreSQL function tries to mimic usage of normal database tables (with support for attribute filtering, limit and offset) in following way: SELECT -- columns to return (defined later) id,title,size FROM pgest( - -- path to index OR URL to node, user-name and password - -- you will need JUST ONE of following two lines, depending - -- on your usage described below, for direct access - '/full/path/to/casket', - -- or for node API specify node URI, login, password - -- and depth of search + -- node URI, login, password and depth of search 'http://localhost:1978/node/trivia', 'admin', 'admin', 42, -- query 'blade runner', @@ -141,9 +108,29 @@ id text, title text, size text ); +You should note that Hyper Estraier uses UTF-8 encoding, while your +PostgreSQL installation might use different encoding. To fix that, use +C function in PostgreSQL to convert encodings. + +=head2 Using index via C server process + +This is default and recommended way to use C functionality. In this +case, C will use node API and access index through C +process which should be running on (local or remote) machine. + +This will remove database opening overhead, at a cost of (small) additional network +traffic. However, you can have Hyper Estraier C process running on +different machine or update index while doing searches, so benefits of this +approach are obvious. + =head2 Accessing database directly -If you want to access database directly (without running C process), first argument is full path to database file. +B As such, it's +not stated in example, and it's kept just for backward compatibility, but it +will probably be removed in future versions of C. + +If you want to access database directly (without running C process), you +have to replace node URI, login, password and depth with full path to database file. Have in mind that C user under which PostgreSQL is running must have read permission on Hyper Estraier database files. @@ -152,19 +139,6 @@ index grows bigger, you might consider using node API to remove overhead of database opening on each query. -B - -=head2 Using index via C server process - -If first argument is URL to node (like C) -and there are two additional parameters (user-name and password) after it, -C will use node API and access index through C process which should be running on (local or remote) machine. - -This will remove database opening overhead, at a cost of additional network -traffic. However, you can have Hyper Estraier C process running on -different machine or update index while doing searches, so benefits of this -approach are obvious. - =head1 Who wrote this? Hyper Estraier is written by Mikio Hirabayashi.