You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Dirk Bromberg <br...@tzi.de> on 2002/05/14 10:58:41 UTC

Indexer does not work ??!

Hi,

I'm testing with xindice birthday, for our project we must store more 
than 500.000 xml files.
Now I've created one collection with 100.000 litle documents, which 
needs 400MB collection disk space.
If I'm searching for one document per xpath it takes about 5 min for 
finding the document.

My question:
if i create an index with:
xindiceadmin add_indexer -c /db/test -n idIndexer -p id
(I'm seraching with this xpath: "//test/id["2447734"]" )
I'm wondering creating xindexer takes no time.
After creating this indexer the search is not faster , why ?? or must I 
create the indexer before adding the documents ??

Thanks

Dirk Bromberg
bromberg@tzi.de



AW: Indexer does not work ??!

Posted by Dirk Bromberg <br...@tzi.de>.
Hi Daniel,

I've xindice 1.0 birthday installed on a 1GHZ AMD Redhat 7.3.

This is my test class:

---------begin class-----------

import java.io.*;
import java.util.*;

import org.xmldb.api.base.*;
import org.xmldb.api.modules.*;
import org.xmldb.api.*;


public class DBTest{

//für das connecten zur db
private org.xmldb.api.base.Collection col;


  public static String createfile(String filename, int count){

    String result="";
   // File tmpfile = new File(filename);
    StringBuffer sbuff = new StringBuffer();
    sbuff.append("<?xml version=\"1.0\"?>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<person>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<pid id=\"24477"+count+"\"></pid>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<icoId>new</icoId>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<dirk>"+count+"</dirk>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<fname>Homer_"+count+"</fname>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<lname>Simpson_"+count+"</lname>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<phone type=\"work\" >123-456-7890_"+count+"</phone>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<phone type=\"home\" >234-567-8901_"+count+"</phone>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<phone type=\"cell\" >456-789-0123_"+count+"</phone>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<email type=\"home\"
>Homäößüer_"+count+"@home.com</email>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<email type=\"work\" >Homer_"+count+"@work.org</email>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<address type=\"home\">1234 W.
Springfield_"+count+"</address>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("<address type=\"work\" >34 N. Atom
Way_"+count+"</address>");
    sbuff.append(System.getProperty("line.separator"));
    sbuff.append("</person>");

    result = sbuff.toString();
    return result;
 }

 public void connect(){
    try {
         String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
         Class c = Class.forName(driver);

         Database database = (Database) c.newInstance();
         DatabaseManager.registerDatabase(database);
         this.col =
            DatabaseManager.getCollection("xmldb:xindice:///db/test1");
    }catch (Exception e) {
         System.err.println("XML:DB Exception occured "
+e.getLocalizedMessage());
      }
  }

  public void disconnect(){
    try{
    if(this.col!=null)
    this.col.close();
    }catch(Exception e) {
         System.err.println("XML:DB Exception occured "
+e.getLocalizedMessage());
      }
  }

    //adding XML Doc to DB

  public void AddXMLDocumentFORMFile(String content) throws Exception{

      try {



         String id = this.col.createId();
         XMLResource document = (XMLResource) col.createResource(id,
            "XMLResource");
         document.setContent(content);
         this.col.storeResource(document);

         //System.out.println("Document  inserted with id: "+id);
  //       System.out.println("updating doc id tag --> start");
         try{
         XUpdate(id);
         }catch (Exception e) {e.printStackTrace(System.out);}
    //     System.out.println("updating doc id tag --> end");

      }
      catch (XMLDBException e) {
         System.err.println("XML:DB Exception occured " + e.errorCode);
      }
   }

    //XUPDATE

   public void XUpdate(String id) throws Exception{
      try {

         String xupdate = "<xu:modifications version=\"1.0\"" +
            "      xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
            "   <xu:update select=\"/person/icoId\"> " +
            id +
            "   </xu:update>" +
            "</xu:modifications>";
      //  System.out.println(xupdate);

         XUpdateQueryService service =
            (XUpdateQueryService) this.col.getService("XUpdateQueryService",
"1.0");
         service.updateResource(id,xupdate);
      }
      catch (XMLDBException e) {
         System.err.println("XML:DB Exception occured " + e.errorCode + " "
+
            e.getMessage());
      }
   }

    //query XPath
   public java.util.Collection queryCollection(String xpath)throws
XMLDBException {
    java.util.Collection ret = new LinkedList();
    XPathQueryService service =
(XPathQueryService)this.col.getService("XPathQueryService","1.0");
    ResourceSet resultSet = service.query(xpath);
    ResourceIterator results = resultSet.getIterator();
    while (results.hasMoreResources()) {
            Resource res = results.nextResource();
            ret.add(res.getContent());
            //System.out.println((String) res.getContent());
    }

    return ret;
   }

    //STATUS
   public int getDocumentCount(){
      int result=0;
     try{
      result = this.col.getResourceCount();
     }catch (XMLDBException e) {
         System.err.println("XML:DB Exception occured " + e.errorCode + " "
+
            e.getMessage());
      }
      return result;
   }

   public DBTest(){
   }

    public static void main(String[] args){

	    LinkedList content = new LinkedList();

	    DBTest test = new DBTest();
	    System.out.println("starten des tests...");
	    test.connect();
	    if(!(test.col==null)){
		    System.out.println("collection not null");
		    content.add(test.createfile(null,0));
                    Iterator ic = content.iterator();
		    while(ic.hasNext()){
			    //System.out.println((String)ic.next());
                            String c = (String)ic.next();
			  for(int i=500;i<0;i++){
			      //System.out.println("Nr: "+i);
                          try{

test.AddXMLDocumentFORMFile(test.createfile(null,i));
                            }catch(Exception e){System.err.println("Error in
addDokument "+e.getMessage());}
			    }
		    }
		    System.out.println("Document count in Collection:
"+test.getDocumentCount());
		    try{
			long t = System.currentTimeMillis();
			System.out.println("starting query");
			LinkedList l = new
LinkedList((test.queryCollection("//person/fname[contains(text(),'1505')]"))
);
			long time = System.currentTimeMillis()-t;
			System.out.println("end query");
			System.out.println("Time: "+time);
			System.out.println("query Result"+l.size());

			Iterator i_l = l.iterator();
	      		while(i_l.hasNext()){
			    System.out.println(i_l.next());

			}

		    }catch (Exception e){System.err.println("Error in queryDokument
"+e.getMessage());}
	    }



    }

}

---------end class-----------

at the begin there is the method to create the "testfiles wich i'm adding to
db"
you must create the collection "db/test1" (see connect() Method).

-- in the main there is a "for(int i=500;i<0;i++){" where i'm creating and
adding the docs...
-- there is a xupdate method wich adds the documentID form the collection to
the document.
-- then there is a
"test.queryCollection("//person/fname[contains(text(),'1505')]"))" where i
tested the different xpath -- searches (this contains(text(),'1505') does
not work with the indexer!!! )

after adding documents to the db i've setup some indexer with the
commandline tools (for the elements and attributes wich i'm searching by the
xpath.)


if there are any questions you can write me a mail.
(german or english)

greats

Dirk Bromberg
bromberg@tzi.de







-----Ursprüngliche Nachricht-----
Von: Daniel Kröger [mailto:zesolo@zesolo.net]
Gesendet: Mittwoch, 12. Juni 2002 00:04
An: xindice-users@xml.apache.org
Betreff: AW: Indexer does not work ??!


Hi Dirk,

How did you quantify the time. Do you have any kind of tool....?

Daniel

> -----Ursprüngliche Nachricht-----
> Von: Dirk Bromberg [mailto:Dirk.Bromberg@t-online.de] Im
> Auftrag von Dirk Bromberg
> Gesendet: Donnerstag, 16. Mai 2002 09:13
> An: xindice-users@xml.apache.org
> Betreff: AW: Indexer does not work ??!
>
>
> That was my problem too,
>
> And so I created the index first and than I added the
> document's to database. And so I can reduce the search time
> by 100.000 doc's from 3min to 30ms (by 500.000docs it takes ca.120ms)
>
> Must be a problem installing indexer after adding documents..
>
> Greets
>
> Dirk Bromberg
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Thomas Rupp [mailto:Pele.Rupp@gmx.de]
> > Gesendet: Donnerstag, 16. Mai 2002 09:02
> > An: xindice-users@xml.apache.org
> > Betreff: Re: Indexer does not work ??!
> >
> >
> > Hello Timo Boehme,
> >
> >
> > I had the same effect. I imported a lot of documents and
> after this I
> > created the index. The xpath search is very slow (not
> better without
> > index).
> >
> > best recards
> > Thomas Rupp
> >
> > > Now I've created a new collection, then I add an indexer for an
> > > attribute..
> > >
> > > then i add 500.000 test documents which have a counter for the
> > > attributevalue
> > >
> > > 1,2GB Data (500MB for the index)
> > >
> > > now the search needs 120ms, that's fast I think.
> > >
> > > great!!!
> > >
> > > Dirk Bromberg
> > >
> > > running xindice 1.0 ,1GHZ AMD, IDE HDD
> > >
> > >
> > >
> > >
> > > Timo Boehme wrote:
> > >
> > > >Hi,
> > > >
> > > >>My question:
> > > >>if i create an index with:
> > > >>xindiceadmin add_indexer -c /db/test -n idIndexer -p id (I'm
> > > >>seraching with this xpath: "//test/id["2447734"]" ) I'm
> wondering
> > > >>creating xindexer takes no time. After creating this
> indexer the
> > > >>search is not faster , why ?? or must I create the
> indexer before
> > > >>adding the documents ??
> > > >>
> > > >
> > > >Is id an attribute or an element? It looks like an element
> > to me. If
> > > >id
> > > is
> > > >an attribute you have to add '@' beforehand.
> > > >
> > > >Nevertheless I tried to do something similar some time ago
> > but got an
> > > >NullPointerExecption when creating the index. I wrote in
> with the
> > > >following mail:
> > > >
> > > >: I would like to create an index for all foo attributes
> within my
> > > >: collection. According to the documentation I specified
> > *@foo as the
> > > index
> > > >: pattern. However the database server throws
> > NullPointerExceptions
> > > >for
> > > all
> > > >: documents within the collection during indexing. The exception
> > > >looks
> > > like
> > > >:
> > > >: DEBUG> java.lang.NullPointerException
> > > >:        at
> > > org.apache.xindice.core.indexer.IndexPattern.getMatchLevel(Unknown
> > > Source)
> > > >:        at
> > >
> > org.apache.xindice.core.indexer.IndexManager$SAXHandler.proces
> > sEntry(Unknown Source)
> > > >:        at
> > >
> >
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.endElement(Unk
> > > nown
> > Source)
> > > >:        at
> > >
> >
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
> > Source)
> > > >:        at
> > >
> >
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
> > Source)
> > > >:        at
> > >
> org.apache.xindice.xml.sax.SAXEventGenerator.processDocument(Unknown
> > Source)
> > > >:        at
> > org.apache.xindice.xml.sax.SAXEventGenerator.start(Unknown
> > > Source)
> > > >:        at
> > >
> >
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.<init>(Unknown
> > Source)
> > > >:        at
> > >
> >
> org.apache.xindice.core.indexer.IndexManager.populateNewIndexers(Unkno
> > > wn
> > Source)
> > > >:        at
> > > org.apache.xindice.core.indexer.IndexManager.access$300(Unknown
> > > Source)
> > > >:        at
> > >
> org.apache.xindice.core.indexer.IndexManager$AutoIndexer.run(Unknown
> > Source)
> > > >:
> > > >: You can easily reproduce this problem:
> > > >:  1. add a collection testcoll to db
> > > >:  2. add a simple document (e.g. <test>text</test>) to
> > /db/testcoll
> > > >:  3. add index with pattern *@foo to /db/testcoll
> > > >:
> > > >: I got this with Xindice RC1 running on Solaris and on
> > Windows 2000.
> > > >
> > > >I got a reply from Tom Bradford:
> > > >
> > > >: I'll try to get this fixed this evening.  It's
> probably something
> > > >: simple, and the result of stupidity. :)
> > > >
> > > >However I haven't heard anything afterwards and the bug
> > seems to be
> > > >still there. Can somebody please have a look on it?
> > > >
> > > >
> > > >
> > > >Best regards,
> > > >Timo
> > > >
> > > >
> > > >---------------------------------------------------
> > > > Dipl. Inf. Timo Boehme     Phone: +49 341 9732166
> > > > University of Leipzig      Fax:   +49 341 9732209
> > > >   Institute of Computer Science, Database Group
> > > >    Augustusplatz 10-11, 04109 Leipzig, Germany
> > > >      email: boehme@informatik.uni-leipzig.de
> > > >---------------------------------------------------
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> > --
> > GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net
> >
> >
>



AW: Indexer does not work ??!

Posted by Daniel Kröger <ze...@zesolo.net>.
Hi Dirk,

How did you quantify the time. Do you have any kind of tool....?

Daniel

> -----Ursprüngliche Nachricht-----
> Von: Dirk Bromberg [mailto:Dirk.Bromberg@t-online.de] Im 
> Auftrag von Dirk Bromberg
> Gesendet: Donnerstag, 16. Mai 2002 09:13
> An: xindice-users@xml.apache.org
> Betreff: AW: Indexer does not work ??!
> 
> 
> That was my problem too,
> 
> And so I created the index first and than I added the 
> document's to database. And so I can reduce the search time 
> by 100.000 doc's from 3min to 30ms (by 500.000docs it takes ca.120ms)
> 
> Must be a problem installing indexer after adding documents..
> 
> Greets
> 
> Dirk Bromberg
> 
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Thomas Rupp [mailto:Pele.Rupp@gmx.de]
> > Gesendet: Donnerstag, 16. Mai 2002 09:02
> > An: xindice-users@xml.apache.org
> > Betreff: Re: Indexer does not work ??!
> > 
> > 
> > Hello Timo Boehme,
> > 
> > 
> > I had the same effect. I imported a lot of documents and 
> after this I 
> > created the index. The xpath search is very slow (not 
> better without 
> > index).
> > 
> > best recards
> > Thomas Rupp
> > 
> > > Now I've created a new collection, then I add an indexer for an 
> > > attribute..
> > > 
> > > then i add 500.000 test documents which have a counter for the
> > > attributevalue
> > > 
> > > 1,2GB Data (500MB for the index)
> > > 
> > > now the search needs 120ms, that's fast I think.
> > > 
> > > great!!!
> > > 
> > > Dirk Bromberg
> > > 
> > > running xindice 1.0 ,1GHZ AMD, IDE HDD
> > > 
> > > 
> > > 
> > > 
> > > Timo Boehme wrote:
> > > 
> > > >Hi,
> > > >
> > > >>My question:
> > > >>if i create an index with:
> > > >>xindiceadmin add_indexer -c /db/test -n idIndexer -p id (I'm 
> > > >>seraching with this xpath: "//test/id["2447734"]" ) I'm 
> wondering 
> > > >>creating xindexer takes no time. After creating this 
> indexer the 
> > > >>search is not faster , why ?? or must I create the 
> indexer before 
> > > >>adding the documents ??
> > > >>
> > > >
> > > >Is id an attribute or an element? It looks like an element
> > to me. If
> > > >id
> > > is
> > > >an attribute you have to add '@' beforehand.
> > > >
> > > >Nevertheless I tried to do something similar some time ago
> > but got an
> > > >NullPointerExecption when creating the index. I wrote in 
> with the 
> > > >following mail:
> > > >
> > > >: I would like to create an index for all foo attributes 
> within my
> > > >: collection. According to the documentation I specified
> > *@foo as the
> > > index
> > > >: pattern. However the database server throws
> > NullPointerExceptions
> > > >for
> > > all
> > > >: documents within the collection during indexing. The exception 
> > > >looks
> > > like
> > > >:
> > > >: DEBUG> java.lang.NullPointerException
> > > >:        at
> > > org.apache.xindice.core.indexer.IndexPattern.getMatchLevel(Unknown
> > > Source)
> > > >:        at
> > >
> > org.apache.xindice.core.indexer.IndexManager$SAXHandler.proces
> > sEntry(Unknown Source)
> > > >:        at
> > > 
> > 
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.endElement(Unk
> > > nown
> > Source)
> > > >:        at
> > > 
> > 
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
> > Source)
> > > >:        at
> > > 
> > 
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
> > Source)
> > > >:        at
> > > 
> org.apache.xindice.xml.sax.SAXEventGenerator.processDocument(Unknown
> > Source)
> > > >:        at 
> > org.apache.xindice.xml.sax.SAXEventGenerator.start(Unknown
> > > Source)
> > > >:        at
> > > 
> > 
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.<init>(Unknown
> > Source)
> > > >:        at
> > > 
> > 
> org.apache.xindice.core.indexer.IndexManager.populateNewIndexers(Unkno
> > > wn
> > Source)
> > > >:        at
> > > org.apache.xindice.core.indexer.IndexManager.access$300(Unknown
> > > Source)
> > > >:        at
> > > 
> org.apache.xindice.core.indexer.IndexManager$AutoIndexer.run(Unknown
> > Source)
> > > >:
> > > >: You can easily reproduce this problem:
> > > >:  1. add a collection testcoll to db
> > > >:  2. add a simple document (e.g. <test>text</test>) to
> > /db/testcoll
> > > >:  3. add index with pattern *@foo to /db/testcoll
> > > >:
> > > >: I got this with Xindice RC1 running on Solaris and on
> > Windows 2000.
> > > >
> > > >I got a reply from Tom Bradford:
> > > >
> > > >: I'll try to get this fixed this evening.  It's 
> probably something
> > > >: simple, and the result of stupidity. :)
> > > >
> > > >However I haven't heard anything afterwards and the bug
> > seems to be
> > > >still there. Can somebody please have a look on it?
> > > >
> > > >
> > > >
> > > >Best regards,
> > > >Timo
> > > >
> > > >
> > > >---------------------------------------------------
> > > > Dipl. Inf. Timo Boehme     Phone: +49 341 9732166
> > > > University of Leipzig      Fax:   +49 341 9732209
> > > >   Institute of Computer Science, Database Group
> > > >    Augustusplatz 10-11, 04109 Leipzig, Germany
> > > >      email: boehme@informatik.uni-leipzig.de
> > > >---------------------------------------------------
> > > >
> > > >
> > > >
> > > 
> > > 
> > > 
> > 
> > --
> > GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net
> > 
> > 
> 


AW: Indexer does not work ??!

Posted by Dirk Bromberg <Di...@t-online.de>.
That was my problem too,

And so I created the index first and than I added the document's to
database. And so I can reduce the search time by 100.000 doc's from 3min to
30ms (by 500.000docs it takes ca.120ms)

Must be a problem installing indexer after adding documents..

Greets

Dirk Bromberg



> -----Ursprüngliche Nachricht-----
> Von: Thomas Rupp [mailto:Pele.Rupp@gmx.de]
> Gesendet: Donnerstag, 16. Mai 2002 09:02
> An: xindice-users@xml.apache.org
> Betreff: Re: Indexer does not work ??!
> 
> 
> Hello Timo Boehme,
> 
> 
> I had the same effect. I imported a lot of documents and
> after this I created the index. The xpath search is very slow 
> (not better without index).
> 
> best recards
> Thomas Rupp
> 
> > Now I've created a new collection, then I add an indexer for an
> > attribute..
> > 
> > then i add 500.000 test documents which have a counter for the 
> > attributevalue
> > 
> > 1,2GB Data (500MB for the index)
> > 
> > now the search needs 120ms, that's fast I think.
> > 
> > great!!!
> > 
> > Dirk Bromberg
> > 
> > running xindice 1.0 ,1GHZ AMD, IDE HDD
> > 
> > 
> > 
> > 
> > Timo Boehme wrote:
> > 
> > >Hi,
> > >
> > >>My question:
> > >>if i create an index with:
> > >>xindiceadmin add_indexer -c /db/test -n idIndexer -p id (I'm
> > >>seraching with this xpath: "//test/id["2447734"]" ) I'm wondering 
> > >>creating xindexer takes no time. After creating this indexer the 
> > >>search is not faster , why ?? or must I create the indexer before 
> > >>adding the documents ??
> > >>
> > >
> > >Is id an attribute or an element? It looks like an element
> to me. If
> > >id
> > is
> > >an attribute you have to add '@' beforehand.
> > >
> > >Nevertheless I tried to do something similar some time ago
> but got an
> > >NullPointerExecption when creating the index. I wrote in with the
> > >following mail:
> > >
> > >: I would like to create an index for all foo attributes within my
> > >: collection. According to the documentation I specified
> *@foo as the
> > index
> > >: pattern. However the database server throws
> NullPointerExceptions
> > >for
> > all
> > >: documents within the collection during indexing. The exception
> > >looks
> > like
> > >:
> > >: DEBUG> java.lang.NullPointerException
> > >:        at
> > org.apache.xindice.core.indexer.IndexPattern.getMatchLevel(Unknown
> > Source)
> > >:        at
> >
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.proces
> sEntry(Unknown Source)
> > >:        at
> > 
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.endElement(Unk
> > nown
> Source)
> > >:        at
> > 
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
> Source)
> > >:        at
> > 
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
> Source)
> > >:        at
> > org.apache.xindice.xml.sax.SAXEventGenerator.processDocument(Unknown
> Source)
> > >:        at 
> org.apache.xindice.xml.sax.SAXEventGenerator.start(Unknown
> > Source)
> > >:        at
> > 
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.<init>(Unknown
> Source)
> > >:        at
> > 
> org.apache.xindice.core.indexer.IndexManager.populateNewIndexers(Unkno
> > wn
> Source)
> > >:        at
> > org.apache.xindice.core.indexer.IndexManager.access$300(Unknown
> > Source)
> > >:        at
> > org.apache.xindice.core.indexer.IndexManager$AutoIndexer.run(Unknown
> Source)
> > >:
> > >: You can easily reproduce this problem:
> > >:  1. add a collection testcoll to db
> > >:  2. add a simple document (e.g. <test>text</test>) to
> /db/testcoll
> > >:  3. add index with pattern *@foo to /db/testcoll
> > >:
> > >: I got this with Xindice RC1 running on Solaris and on
> Windows 2000.
> > >
> > >I got a reply from Tom Bradford:
> > >
> > >: I'll try to get this fixed this evening.  It's probably something
> > >: simple, and the result of stupidity. :)
> > >
> > >However I haven't heard anything afterwards and the bug
> seems to be
> > >still there. Can somebody please have a look on it?
> > >
> > >
> > >
> > >Best regards,
> > >Timo
> > >
> > >
> > >---------------------------------------------------
> > > Dipl. Inf. Timo Boehme     Phone: +49 341 9732166
> > > University of Leipzig      Fax:   +49 341 9732209
> > >   Institute of Computer Science, Database Group
> > >    Augustusplatz 10-11, 04109 Leipzig, Germany
> > >      email: boehme@informatik.uni-leipzig.de
> > >---------------------------------------------------
> > >
> > >
> > >
> > 
> > 
> > 
> 
> --
> GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net
> 
> 

Re: Indexer does not work ??!

Posted by Thomas Rupp <Pe...@gmx.de>.
Hello Timo Boehme,


I had the same effect. I imported a lot of documents and after this I
created the index. The xpath search is very slow (not better without index).

best recards
Thomas Rupp

> Now I've created a new collection, then I add an indexer for an
> attribute..
> 
> then i add 500.000 test documents which have a counter for the 
> attributevalue
> 
> 1,2GB Data (500MB for the index)
> 
> now the search needs 120ms, that's fast I think.
> 
> great!!!
> 
> Dirk Bromberg
> 
> running xindice 1.0 ,1GHZ AMD, IDE HDD
> 
> 
> 
> 
> Timo Boehme wrote:
> 
> >Hi,
> >
> >>My question:
> >>if i create an index with:
> >>xindiceadmin add_indexer -c /db/test -n idIndexer -p id
> >>(I'm seraching with this xpath: "//test/id["2447734"]" )
> >>I'm wondering creating xindexer takes no time.
> >>After creating this indexer the search is not faster , why ?? or must I 
> >>create the indexer before adding the documents ??
> >>
> >
> >Is id an attribute or an element? It looks like an element to me. If id
> is
> >an attribute you have to add '@' beforehand.
> >
> >Nevertheless I tried to do something similar some time ago but got an
> >NullPointerExecption when creating the index. I wrote in with the
> >following mail:
> >
> >: I would like to create an index for all foo attributes within my
> >: collection. According to the documentation I specified *@foo as the
> index
> >: pattern. However the database server throws NullPointerExceptions for
> all
> >: documents within the collection during indexing. The exception looks
> like
> >:
> >: DEBUG> java.lang.NullPointerException
> >:        at
> org.apache.xindice.core.indexer.IndexPattern.getMatchLevel(Unknown Source)
> >:        at
>
org.apache.xindice.core.indexer.IndexManager$SAXHandler.processEntry(Unknown Source)
> >:        at
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.endElement(Unknown
Source)
> >:        at
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
Source)
> >:        at
> org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown
Source)
> >:        at
> org.apache.xindice.xml.sax.SAXEventGenerator.processDocument(Unknown
Source)
> >:        at org.apache.xindice.xml.sax.SAXEventGenerator.start(Unknown
> Source)
> >:        at
> org.apache.xindice.core.indexer.IndexManager$SAXHandler.<init>(Unknown
Source)
> >:        at
> org.apache.xindice.core.indexer.IndexManager.populateNewIndexers(Unknown
Source)
> >:        at
> org.apache.xindice.core.indexer.IndexManager.access$300(Unknown Source)
> >:        at
> org.apache.xindice.core.indexer.IndexManager$AutoIndexer.run(Unknown
Source)
> >:
> >: You can easily reproduce this problem:
> >:  1. add a collection testcoll to db
> >:  2. add a simple document (e.g. <test>text</test>) to /db/testcoll
> >:  3. add index with pattern *@foo to /db/testcoll
> >:
> >: I got this with Xindice RC1 running on Solaris and on Windows 2000.
> >
> >I got a reply from Tom Bradford:
> >
> >: I'll try to get this fixed this evening.  It's probably something 
> >: simple, and the result of stupidity. :)
> >
> >However I haven't heard anything afterwards and the bug seems to be still
> >there. Can somebody please have a look on it?
> >
> >
> >
> >Best regards,
> >Timo
> >
> >
> >---------------------------------------------------
> > Dipl. Inf. Timo Boehme     Phone: +49 341 9732166
> > University of Leipzig      Fax:   +49 341 9732209
> >   Institute of Computer Science, Database Group
> >    Augustusplatz 10-11, 04109 Leipzig, Germany
> >      email: boehme@informatik.uni-leipzig.de
> >---------------------------------------------------
> >
> >
> >
> 
> 
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


Re: Need help creating XML object

Posted by Nutan Kaul <nk...@mail.arc.nasa.gov>.
Hi Dirk,
I am in the dir where my class file is
(org.apache.xindice.examples.XPathQueryXMLObjectNK.class)
but I still can not create the object:

 xindiceadmin add_xmlobject -i
org.apache.xindice.examples.XPathQueryXMLObjectNK -n MyXpath1 -c
/db/addressbook
ERROR : XMLObject Cannot Create

Thanks for your help.
-Nutan


----- Original Message -----
From: "Dirk Bromberg" <Di...@t-online.de>
To: <xi...@xml.apache.org>
Sent: Wednesday, May 15, 2002 12:53 PM
Subject: AW: Need help creating XML object


You don't need to add the .class file to the /lib dir.

You yust must do this:

xindiceadmin add_xmlobject -i
org.apache.xindice.examples.HelloWorldXMLObject -n Hello -c /db/addressbook

If you are in the directory where the class file is. (change class name to
yours)

Greets

Dirk Bromberg
bromberg@tzi.de


> -----Ursprüngliche Nachricht-----
> Von: Nutan Kaul [mailto:nkaul@mail.arc.nasa.gov]
> Gesendet: Mittwoch, 15. Mai 2002 21:03
> An: xindice-users@xml.apache.org
> Betreff: Need help creating XML object
>
>
> Hi,
> I am using xindice 1.0 on Unix and trying to build an XML
> object using the exaples given in the User's guide. I have
> changed the
> org.apache.xindice.examples.XPathQueryXMLObject.java  to
> org.apache.xindice.examples.XPathQueryXMLObjectNK.java and
> have compiled it and copied the XPathQueryXMLObjectNK.class
> file to $XINDICE_HOME/java/lib The java classpath points to
> the right jar files.
>
> Now, when I tri to install the xml object, I get 'Can not
> create xml object" and subsequently 'duplicate xml object' error.
>
> > xindiceadmin add_xmlobject -i
> org.apache.xindice.examples.XPathQueryXMLObjectNK -n NKXpath
> -c /db/addressbook ERROR : XMLObject Cannot Create
>
> >xindiceadmin add_xmlobject -i
> org.apache.xindice.examples.XPathQueryXMLObjectNK -n NKXpath
> -c /db/addressbook ERROR : XMLObject Duplicate Object
>
> When I try to delete object, it does not find the object.
>
> Can someone please tell me what is it I am doing wrong?
>
> Thanks a lot in advance.
>
> -Nutan
>
>


AW: Need help creating XML object

Posted by Dirk Bromberg <Di...@t-online.de>.
You don't need to add the .class file to the /lib dir.

You yust must do this:

xindiceadmin add_xmlobject -i
org.apache.xindice.examples.HelloWorldXMLObject -n Hello -c /db/addressbook

If you are in the directory where the class file is. (change class name to
yours)

Greets

Dirk Bromberg
bromberg@tzi.de


> -----Ursprüngliche Nachricht-----
> Von: Nutan Kaul [mailto:nkaul@mail.arc.nasa.gov] 
> Gesendet: Mittwoch, 15. Mai 2002 21:03
> An: xindice-users@xml.apache.org
> Betreff: Need help creating XML object
> 
> 
> Hi,
> I am using xindice 1.0 on Unix and trying to build an XML 
> object using the exaples given in the User's guide. I have 
> changed the 
> org.apache.xindice.examples.XPathQueryXMLObject.java  to 
> org.apache.xindice.examples.XPathQueryXMLObjectNK.java and 
> have compiled it and copied the XPathQueryXMLObjectNK.class 
> file to $XINDICE_HOME/java/lib The java classpath points to 
> the right jar files.
> 
> Now, when I tri to install the xml object, I get 'Can not 
> create xml object" and subsequently 'duplicate xml object' error.
> 
> > xindiceadmin add_xmlobject -i
> org.apache.xindice.examples.XPathQueryXMLObjectNK -n NKXpath 
> -c /db/addressbook ERROR : XMLObject Cannot Create
> 
> >xindiceadmin add_xmlobject -i
> org.apache.xindice.examples.XPathQueryXMLObjectNK -n NKXpath 
> -c /db/addressbook ERROR : XMLObject Duplicate Object
> 
> When I try to delete object, it does not find the object.
> 
> Can someone please tell me what is it I am doing wrong?
> 
> Thanks a lot in advance.
> 
> -Nutan
> 
> 

Need help creating XML object

Posted by Nutan Kaul <nk...@mail.arc.nasa.gov>.
Hi,
I am using xindice 1.0 on Unix and trying to build an XML object using the
exaples given in the User's guide.
I have changed the org.apache.xindice.examples.XPathQueryXMLObject.java  to
org.apache.xindice.examples.XPathQueryXMLObjectNK.java and have compiled it
and copied the XPathQueryXMLObjectNK.class file to $XINDICE_HOME/java/lib
The java classpath points to the right jar files.

Now, when I tri to install the xml object, I get 'Can not create xml object"
and subsequently 'duplicate xml object' error.

> xindiceadmin add_xmlobject -i
org.apache.xindice.examples.XPathQueryXMLObjectNK -n NKXpath -c
/db/addressbook
ERROR : XMLObject Cannot Create

>xindiceadmin add_xmlobject -i
org.apache.xindice.examples.XPathQueryXMLObjectNK -n NKXpath -c
/db/addressbook
ERROR : XMLObject Duplicate Object

When I try to delete object, it does not find the object.

Can someone please tell me what is it I am doing wrong?

Thanks a lot in advance.

-Nutan


Re: Indexer does not work ??!

Posted by Dirk Bromberg <br...@tzi.de>.
Now I've created a new collection, then I add an indexer for an attribute..

then i add 500.000 test documents which have a counter for the 
attributevalue

1,2GB Data (500MB for the index)

now the search needs 120ms, that's fast I think.

great!!!

Dirk Bromberg

running xindice 1.0 ,1GHZ AMD, IDE HDD




Timo Boehme wrote:

>Hi,
>
>>My question:
>>if i create an index with:
>>xindiceadmin add_indexer -c /db/test -n idIndexer -p id
>>(I'm seraching with this xpath: "//test/id["2447734"]" )
>>I'm wondering creating xindexer takes no time.
>>After creating this indexer the search is not faster , why ?? or must I 
>>create the indexer before adding the documents ??
>>
>
>Is id an attribute or an element? It looks like an element to me. If id is
>an attribute you have to add '@' beforehand.
>
>Nevertheless I tried to do something similar some time ago but got an
>NullPointerExecption when creating the index. I wrote in with the
>following mail:
>
>: I would like to create an index for all foo attributes within my
>: collection. According to the documentation I specified *@foo as the index
>: pattern. However the database server throws NullPointerExceptions for all
>: documents within the collection during indexing. The exception looks like
>:
>: DEBUG> java.lang.NullPointerException
>:        at org.apache.xindice.core.indexer.IndexPattern.getMatchLevel(Unknown Source)
>:        at org.apache.xindice.core.indexer.IndexManager$SAXHandler.processEntry(Unknown Source)
>:        at org.apache.xindice.core.indexer.IndexManager$SAXHandler.endElement(Unknown Source)
>:        at org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown Source)
>:        at org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown Source)
>:        at org.apache.xindice.xml.sax.SAXEventGenerator.processDocument(Unknown Source)
>:        at org.apache.xindice.xml.sax.SAXEventGenerator.start(Unknown Source)
>:        at org.apache.xindice.core.indexer.IndexManager$SAXHandler.<init>(Unknown Source)
>:        at org.apache.xindice.core.indexer.IndexManager.populateNewIndexers(Unknown Source)
>:        at org.apache.xindice.core.indexer.IndexManager.access$300(Unknown Source)
>:        at org.apache.xindice.core.indexer.IndexManager$AutoIndexer.run(Unknown Source)
>:
>: You can easily reproduce this problem:
>:  1. add a collection testcoll to db
>:  2. add a simple document (e.g. <test>text</test>) to /db/testcoll
>:  3. add index with pattern *@foo to /db/testcoll
>:
>: I got this with Xindice RC1 running on Solaris and on Windows 2000.
>
>I got a reply from Tom Bradford:
>
>: I'll try to get this fixed this evening.  It's probably something 
>: simple, and the result of stupidity. :)
>
>However I haven't heard anything afterwards and the bug seems to be still
>there. Can somebody please have a look on it?
>
>
>
>Best regards,
>Timo
>
>
>---------------------------------------------------
> Dipl. Inf. Timo Boehme     Phone: +49 341 9732166
> University of Leipzig      Fax:   +49 341 9732209
>   Institute of Computer Science, Database Group
>    Augustusplatz 10-11, 04109 Leipzig, Germany
>      email: boehme@informatik.uni-leipzig.de
>---------------------------------------------------
>
>
>




Re: Indexer does not work ??!

Posted by Timo Boehme <bo...@informatik.uni-leipzig.de>.
Hi,

> My question:
> if i create an index with:
> xindiceadmin add_indexer -c /db/test -n idIndexer -p id
> (I'm seraching with this xpath: "//test/id["2447734"]" )
> I'm wondering creating xindexer takes no time.
> After creating this indexer the search is not faster , why ?? or must I 
> create the indexer before adding the documents ??

Is id an attribute or an element? It looks like an element to me. If id is
an attribute you have to add '@' beforehand.

Nevertheless I tried to do something similar some time ago but got an
NullPointerExecption when creating the index. I wrote in with the
following mail:

: I would like to create an index for all foo attributes within my
: collection. According to the documentation I specified *@foo as the index
: pattern. However the database server throws NullPointerExceptions for all
: documents within the collection during indexing. The exception looks like
:
: DEBUG> java.lang.NullPointerException
:        at org.apache.xindice.core.indexer.IndexPattern.getMatchLevel(Unknown Source)
:        at org.apache.xindice.core.indexer.IndexManager$SAXHandler.processEntry(Unknown Source)
:        at org.apache.xindice.core.indexer.IndexManager$SAXHandler.endElement(Unknown Source)
:        at org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown Source)
:        at org.apache.xindice.xml.sax.SAXEventGenerator.processContainer(Unknown Source)
:        at org.apache.xindice.xml.sax.SAXEventGenerator.processDocument(Unknown Source)
:        at org.apache.xindice.xml.sax.SAXEventGenerator.start(Unknown Source)
:        at org.apache.xindice.core.indexer.IndexManager$SAXHandler.<init>(Unknown Source)
:        at org.apache.xindice.core.indexer.IndexManager.populateNewIndexers(Unknown Source)
:        at org.apache.xindice.core.indexer.IndexManager.access$300(Unknown Source)
:        at org.apache.xindice.core.indexer.IndexManager$AutoIndexer.run(Unknown Source)
:
: You can easily reproduce this problem:
:  1. add a collection testcoll to db
:  2. add a simple document (e.g. <test>text</test>) to /db/testcoll
:  3. add index with pattern *@foo to /db/testcoll
:
: I got this with Xindice RC1 running on Solaris and on Windows 2000.

I got a reply from Tom Bradford:

: I'll try to get this fixed this evening.  It's probably something 
: simple, and the result of stupidity. :)

However I haven't heard anything afterwards and the bug seems to be still
there. Can somebody please have a look on it?



Best regards,
Timo


---------------------------------------------------
 Dipl. Inf. Timo Boehme     Phone: +49 341 9732166
 University of Leipzig      Fax:   +49 341 9732209
   Institute of Computer Science, Database Group
    Augustusplatz 10-11, 04109 Leipzig, Germany
      email: boehme@informatik.uni-leipzig.de
---------------------------------------------------