5

My xml file is with the structure

<root>
    <compound>abc<parts>a b c</parts></compound>
    <compound>xyz<parts>x y z</parts></compound>
</root>

I have created a range index on

<range>
    <create qname="compound" type="xs:string"/>
</range>

I expected the index terms are abca b c and xyzx y z but I found abc and xyz under index link in monitoring and profiling window. And also the search string

//compound[.="abca b c"] giving 0 results.

Can any one help in creating index on the whole contents of compound like on abca b c, xyz x y z so on..

Thanks

sony

adamretter
  • 3,885
  • 2
  • 23
  • 43

2 Answers2

0

In xquery, you have to use data() function in order to return all of the descendant or the sub-element values. So, to test if the values of the compound element can be returned you can use the following:

//compound/data()[.="abca b c"]
Kindle Q
  • 944
  • 2
  • 19
  • 28
0
 nested="yes" attribute solved the problem.

I have changed the range index to

<range>
    <create qname="compound" type="xs:string" nested="yes" />
</range>