I have records that look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<person>
<account>
<domain>ABBVIENET</domain>
<username>TANGTJ</username>
<status>ENABLED</status>
</account>
<company>AbbVie Inc. (Parent)</company>
<displayName>Tj Tang</displayName>
<upi>10025613</upi>
<firstName>
<preferred>TJ</preferred>
<given>Tze-John</given>
</firstName>
<middleName/>
<lastName>
<preferred>Tang</preferred>
<given>Tang</given>
</lastName>
<secondaryLastName/>
<address>
<streetAddress>1 N Waukegan Road</streetAddress>
<buildingCode>AP52</buildingCode>
<city>North Chicago</city>
<state>Illinois</state>
<country>
<code>US</code>
<name>United States</name>
</country>
</address>
<emailAddress>tze-john.tang@abbvie.com</emailAddress>
<title>Principal Research Scientist</title>
<managerUpi>10009618</managerUpi>
</person>
When I search using:
search:search("Tang TJ AbbVie")
I get:
<search:snippet>
<search:match path="fn:doc("/person/10025613.xml")/person/company"><search:highlight>AbbVie</search:highlight> Inc. (Parent)
</search:match>
<search:match path="fn:doc("/person/10025613.xml")/person/displayName">Tj <search:highlight>Tang</search:highlight></search:match>
<search:match path="fn:doc("/person/10025613.xml")/person/firstName">
<search:highlight>TJ</search:highlight>
</search:match>
<search:match path="fn:doc("/person/10025613.xml")/person/lastName">
<search:highlight>Tang</search:highlight>
</search:match>
</search:snippet>
Where it sort of shows me the element where the match is, i.e. match is in /person/firstName/preferred, and it shows /person/firstName.
If I search for the upi value:
search:search("10025613")
I get:
<search:snippet>
<search:match path="fn:doc("/person/10025613.xml")/person">
<search:highlight>10025613</search:highlight>
</search:match>
</search:snippet>
In this case I don't even get a lower level element for the context. How is the element path determined on a snippet? I tried to add an element range index for the upi value, but still ended up with the same result.