I am trying to tier Marklogic 9 via query assignment policy. I created 2 tiers (as partitions) in "Documents" database with partition names as:
- Part1 , partition number is 1, Default partition (no assigned query)
- Part2 , partition number is 2
In database documents are stored as JSON and i want to tier them according do "DYil" property of documents.
Sample JSON doc that exists in db:
{
"Yerlesim": "Izmir",
"Ad": "AAA",
"@timestamp": "2018-06-02T21:16:23.647Z",
"SoyAd": "BBB",
"@version": "1",
"DYil": "2010-01-01",
"host": "dhcppc6",
"Yas": 8,
"type": "testA",
}
The configuration of the database is done according to Marklogic documentation, following these instructions:
The assigned query for partition Part2 is:
<partition-query-properties xmlns="http://marklogic.com/manage/partition-query/properties">
<partition-number>2</partition-number>
<query>
<cts:json-property-range-query operator="<" xmlns:cts="http://marklogic.com/cts">
<cts:property>DYil</cts:property>
<cts:value xsi:type="xs:date" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1960-01-01</cts:value>
</cts:json-property-range-query>
</query>
</partition-query-properties>
I can see query is assigned correctly to partition via rest api by calling http://localhost:8002/manage/v2/databases/Documents/partition-queries
But when I load data to Marklogic, all data is loaded to default partition and stays there even if I force rebalancer to work.
Xquery console query is:
cts:search(fn:collection(), cts:json-property-range-query("DYil", "<", xs:date("1960-01-01")), (), (), ts:partition-forests(xdmp:database("Documents"),"Part1"))
I converted cts:query expression cts:json-property-range-query("DYil", "<", xs:date("1960-01-01"))
to XML format with using <root>{cts:json-property-range-query("DYil", "<", xs:date("1960-01-01"))}</root>/node()
code as suggested at Marklogic site.
There is no failed log record at Error logs so I suspect there is a problem about assigned query but not able to locate problem.