Oh yes, the Indexer works.
Inspired by the Test-Script of Dirk, i did my own one. In fact it was only
because I'm using Perl and my PC doesn't know what a JDK is :-)
Inserting 100.000 documents I could limit the query time from 83,39 sec.
without Indexer to 0,291 sec. with Indexer.

If anyone is interested, here it is. For detailed explanation you can easily
mailt to
mailto:[EMAIL PROTECTED]

#------Begin-------

use strict;
use Frontier::Client;
use Time::HiRes qw(gettimeofday tv_interval);


my $_collection_name = 'dbtest';
my $id;
my $doccount = '100000';
my $node_id = '1569';
my $query = '/[EMAIL PROTECTED]''.$node_id.'\']';

# Make an object to represent the XML-RPC server.
my $server_url = 'http://localhost:4080';
my $self = Frontier::Client->new(url => $server_url);

        print "Starting Test...\n\n";
        print "Inserting $doccount documents...\n";

my $t0 = [gettimeofday];

        for($id = 0; $id<$doccount; $id++)
        {
                my $docname = $id . ".doc";
                my $response = $self->call('db.insertDocument',
                                         "/db/$_collection_name",
                                          $docname,
                                           generateDoc($id));
        }

my  $t1 = [gettimeofday];
my $t0_t1 = tv_interval $t0, $t1;

        print "Insert-time: " . $t0_t1. " Sec.\n";
        print "Starting XPath query...\n";

my $t2 = [gettimeofday];

        my $result = $self->call('db.queryCollection',
                           "/db/$_collection_name",
                           'XPath',
                           $query,
                           {X => "http://www.xmldb.org/xpath"});

my  $t3 = [gettimeofday];
my $t2_t3 = tv_interval $t2, $t3;

        print "Query-time: " . $t2_t3. " Sec.\n";
        print "Result:\n" . $result. "\n";
        print "Deleting all documents...\n";

        for($id = ($doccount-1); $id>=0; $id--)
        {
                my $docname = $id . ".doc";
                my $response = $self->call('db.removeDocument',
                                         "/db/$_collection_name",
                                          $docname);
        }
        print "Test completed!\n";

sub generateDoc {
        my ($id) = @_;

        my $docstring = '<?xml version="1.0"?>
        <document node_id="';
        $docstring .= $id;
        $docstring .= '">
        <parent_node_id>4</parent_node_id>
        <meta name="__imperia_uid">1</meta>
        <meta name="metafile">testmeta.meta</meta>
        <meta name="__imperia_meta_expand">1</meta>
        <meta name="__imperia_modified">1023444644</meta>
        <meta name="__imperia_created">1023444644</meta>
        <template>ScriptTest</template>
        <filename>index.html</filename>
        <directory>/</directory>
        </imperia_document>';

        return $docstring;
}


1;#Don't forget this!!!

#------End-------

Daniel


> -----Ursprungliche Nachricht-----
> Von: Dirk Bromberg [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 12. Juni 2002 22:34
> An: [email protected]
> Betreff: Re Indexer does not work !?!
>
>
> I already know that the indexer can't work with the contains function, but
> it works perfectly with a 'normal' search. :-)
>
> greets
>
> Dirk Bromberg
> [EMAIL PROTECTED]
>
>

Reply via email to