Shalini
Shalini

Reputation: 348

Path Range Query not working as expected in MarkLogic

I am having two scenarios where path range query is behaving differently-

1. cts:search(fn:doc(), 
       cts:path-range-query("/test/path/node/Id","=","ABC_123"))

The above query giving me correct results

2. cts:search(fn:doc(), 
           cts:path-range-query("/test/path/node/Id","=","ABC 123"))

The Second query is not fetching any results. The document are present in Database for both ABC_123 and ABC 123

I have created the path range index on /test/path/node/Id.

Any Suggestions ??

Upvotes: 0

Views: 118

Answers (1)

Akbar aLI
Akbar aLI

Reputation: 338

@Shalini,

I tested both queries on the console, working fine with little changes in the path:

 I mentioned in path range index is : test/path/node/id instead of /test/path/node/Id

Files tested on the console:

 a.xml:

  <test>
  <path>
  <node><id>ABC 123</id></node>
  </path>
  </test>

b.xml

<test>
<path>
<node><id>ABC_123</id></node>
</path>
</test>

The result is coming by both queries.

Upvotes: 2

Related Questions