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 "Dr. Klemens Waldhör" <Wa...@t-online.de> on 2002/07/17 07:56:11 UTC

Indexes, attributes and XPATH usage

Hi,

I am importing a lot of documents into a XINDICE.

Documents look like that:

<?xml version='1.0' encoding='UTF-8' ?>
<tmx version='1.3'>
<header
	creationtool='tool'
	creationtoolversion='blabla'
	creationdate='20020716T153854Z'
	datatype='plaintext'
	segtype='segment'
	adminlang='EN-US'
	srclang='en'
	o-tmf='xxxxx'>
</header>
<body>
	<tu tuid='1' creationid='20020716T153854Z#1#790893209'>
		<prop type='sourceFile'>xxx.htm</prop>
		<prop type='targetFile'>yyy.htm</prop>
		<prop type='sourceSegNumber'>1</prop>
		<prop type='targetSegNumber'>1</prop>
		<tuv xml:lang="en"
creationid='20020716T153854Z#1#790893209.en'>
			<seg>This is a segment</seg>
		</tuv>
		<tuv xml:lang="de"
creationid='20020716T153854Z#1#790893209.de'>
			<seg>Das ist ein Satz.</seg>
		</tuv>
	</tu>
	....
</body>
</tmx>

The following creates a huge number of sub collections and documents in
there.

call xindiceadmin.bat dc -c /db -n test
call xindiceadmin.bat ac -c /db -n /test
call xindiceadmin.bat import -c /db/test -f dir -e xml

I am now using the following indexing command:

call xindiceadmin.bat ai -c /db/test -n testtuid -p tu[@tuid] -t int
call xindiceadmin.bat ai -c /db/test -n testtucreationid -p
tu[@creationid] -t string
call xindiceadmin.bat ai -c /db/test -n testtuvcreationid -p
tuv[@creationid] -t string

When searching I am using:

xindice.bat xpath_query -c /db/test -q
"tu[@creationid='20020716T153854Z#1#790893209']"
or 
xindice.bat xpath_query -c /db/test -q
"/tmx/body/tu[@creationid='20020716T153854Z#1#790893209']"
Etc.

But I never get any results back - although the entries are in - as I
can see them in the XINDICE browser. Does the xpath_query search through
sub collections ? Or is the xpath statement wrong ?

Any idea what's wrong ? 

And is there a command available which allows to get the keys/names of
all the documents in a collection and/or its sub collections ? 

Thanks for your help !

Klemens


AW: Indexes, attributes and XPATH usage

Posted by "Dr. Klemens Waldhör" <Wa...@t-online.de>.
Hi,

After some tests I have the impression that xindice's xpath queries do
not work through nested-collections, just at the level of the specified
collection.

I could show this as I find the matching entries if I fully qualify the
collection, but if I do the same on a collection "higher up in the tree"
I do not find the match anymore.

Is this assumption correct ? And does it apply to the indexing
meachanism too ?

(I am using Windows XP).

Klemens

-----Ursprüngliche Nachricht-----
Von: Dr. Klemens Waldhör [mailto:Waldhoer@t-online.de] 
Gesendet: Mittwoch, 17. Juli 2002 07:56
An: xindice-users@xml.apache.org
Betreff: Indexes, attributes and XPATH usage


Hi,

I am importing a lot of documents into a XINDICE.

Documents look like that:

<?xml version='1.0' encoding='UTF-8' ?>
<tmx version='1.3'>
<header
	creationtool='tool'
	creationtoolversion='blabla'
	creationdate='20020716T153854Z'
	datatype='plaintext'
	segtype='segment'
	adminlang='EN-US'
	srclang='en'
	o-tmf='xxxxx'>
</header>
<body>
	<tu tuid='1' creationid='20020716T153854Z#1#790893209'>
		<prop type='sourceFile'>xxx.htm</prop>
		<prop type='targetFile'>yyy.htm</prop>
		<prop type='sourceSegNumber'>1</prop>
		<prop type='targetSegNumber'>1</prop>
		<tuv xml:lang="en"
creationid='20020716T153854Z#1#790893209.en'>
			<seg>This is a segment</seg>
		</tuv>
		<tuv xml:lang="de"
creationid='20020716T153854Z#1#790893209.de'>
			<seg>Das ist ein Satz.</seg>
		</tuv>
	</tu>
	....
</body>
</tmx>

The following creates a huge number of sub collections and documents in
there.

call xindiceadmin.bat dc -c /db -n test
call xindiceadmin.bat ac -c /db -n /test
call xindiceadmin.bat import -c /db/test -f dir -e xml

I am now using the following indexing command:

call xindiceadmin.bat ai -c /db/test -n testtuid -p tu[@tuid] -t int
call xindiceadmin.bat ai -c /db/test -n testtucreationid -p
tu[@creationid] -t string call xindiceadmin.bat ai -c /db/test -n
testtuvcreationid -p tuv[@creationid] -t string

When searching I am using:

xindice.bat xpath_query -c /db/test -q
"tu[@creationid='20020716T153854Z#1#790893209']"
or 
xindice.bat xpath_query -c /db/test -q
"/tmx/body/tu[@creationid='20020716T153854Z#1#790893209']"
Etc.

But I never get any results back - although the entries are in - as I
can see them in the XINDICE browser. Does the xpath_query search through
sub collections ? Or is the xpath statement wrong ?

Any idea what's wrong ? 

And is there a command available which allows to get the keys/names of
all the documents in a collection and/or its sub collections ? 

Thanks for your help !

Klemens