Mixed Content Range Index node in exist db

My xml file with structure

<root> <compound>abc<parts>ab c</parts></compound> <compound>xyz<parts>xy z</parts></compound> </root> 

I created a range index on

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

I expected the index terms abca b c and xyzx y z , but I found abc and xyz by the index link in the monitoring and profiling window. As well as the search bar

 //compound[.="abca bc"] giving 0 results. 

Can anyone help in creating an index for the entire contents of the connection, for example, on abca b c , xyz x y z and so on.

thanks

Sony

+5
source share
2 answers

In xquery, you need to use the data() function to return all the values โ€‹โ€‹of the descendants or subelements. So, to check if the values โ€‹โ€‹of a compound element can be returned, you can use the following:

 //compound/data()[.="abca bc"] 
0
source
  nested="yes" attribute solved the problem. 

I changed the range index to

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

Source: https://habr.com/ru/post/1246206/


All Articles