I have to search a xml based on two attributes and it's element value. For this I have used cts:near-query with distance zero. But am getting xml that doesn't contain the matching value. I have enabled the position values in settings and done reindexing, too. Please find the below XML Mismatched XML one:
<cars>
<car a="subject" b="89">Indian Bank</car>
<car a="subject" b="79">Central Banks</car>
<car a="subject" b="90">Coriando banks</car>
</cars>
I have query like cts:near-query
with two attribute range query with a=subject
and b>=89
and with one element word query central banks
with distance zero. I don't want this XML to be returned while searching. Please help me in resolving this.
Exact rules: The XML which contains a=subject and b>=89 and element value of Central banks should be returned while searching. But with the below query in comment am getting the above document.
cts:and-query((
cts:near-query((
cts:element-attribute-range-query(xs:QName("car"), xs:QName("b), ">=", 89),
cts:element-attribute-range-query(xs:QName("car"), xs:QName("a), "=", "subject"),
cts:element-word-query(xs:qname("car"), "Central Banks")
),0)
))