I create range-element-index on property_x, I set scalar-type to int and I want to perform jsonPropertyRangeQuery on it. But for value that are technically valid it throw error: No decimal element range index for property_x.
Before I perform jsonPropertyRangeQuery I check if type of number is in integer range like in this way: xdmp.type(100000025131) and it return 'integer' so I think it is correct value because xdmp.type(10000002513100000)) will return 'double'.
How I can check if the value are able to be use in jsonPropertyRangeQuery?
Index the value as
xs:longand then you can search without error:I think there may be some confusion and issues between JavaScript
Number(and in newer version of V8 that MarkLogic isn't yet using,BigInt) and XML Schema numeric types and ranges forxs:intandxs:integer,xs:long,xs:unsignedLong, etc.Although,
xdmp.type(100000025131)returnsinteger, andparseInt('100000025131') === 100000025131returnstrue.xs.int('100000025131')(max is2147483647) throws:xs.unsignedInt('100000025131')(max is4294967295) throws:xs.integer('100000025131')returnsxs.integerwith the value100000025131xs.long('100000025131')returnsxs.longwith the value100000025131There is an option for indexing as
xs:int,xs:unsignedInt,xs:long, andxs:unsignedLong, but notxs:integer.It would be good if you could open a MarkLogic Support ticket and ask for clarification about why
xdmp.type(100000025131)reportsinteger, or maybe what documentation there is (or needs to be) to describe how the simple typeintegermaps to the schema typesxs.integer,xs.int,xs.long, etc.?