Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Geert Josten
The only workaround using the int index that I could think of would be to use ranges with range-queries. Something like: let $pattern := 200 return cts:or-query(( for $i in 0 to 10 let $power := xs:int(math:pow(10, $i)) let $start := $pattern * $power let $end := ($pattern + 1) * $power

Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Evan Lenz
Hi Oleksii, You'll have to create a string range index too. I've never used cts:element-value-match() with anything but a string index, but it looks like it's possible: you just get back the value you asked for, if it exists. And now that I think about it, that can be rather useful! So thanks for

Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Oleksii Segeda
Christopher, It gives false positives if I use it with cts:element-values. Shan, The rule is to find all values which start with given value. For example, 200 should match 200, 2001, 2002, ... 20010, 20020, 2002123, etc.. Are you suggesting to guess all possible combinations? If so, it's not p

Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Shan Jiang
What is your exact search rule? From your example, looks like you try to look for another number by adding a ³0². If that is the case, can you run a cts:or-query, one for 200, and one for 2000? Shan Jiang Principal Consultant MarkLogic Corporation shan.ji...@marklogic.com Phone: +1 703 869 4672 ww

Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Christopher Hamlin
Does element-value-query work for you? You might need wildcard indexes, but perhaps you have them on. On Fri, Jun 16, 2017 at 6:16 PM, Oleksii Segeda wrote: > Hi everyone, > > Can someone explain how does cts:element-value-match work with integer > indexes? I cannot pass a string as a second ar

Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Sewell, David R. (drs2n)
I'm willing to be corrected by a MarkLogic guru, but my understanding is that wildcard searches are applicable only to string data types. So if you want to enable a "wildcard match" on a numeric index, you would in fact have to create a second index on your element with type xs:string and evalu

Re: [MarkLogic Dev General] cts:element-value-match for integers

2017-06-19 Thread Oleksii Segeda
Hi everyone, Any thoughts on this? Oleksii. -Original Message- From: Oleksii Segeda Sent: Friday, June 16, 2017 6:16 PM To: general@developer.marklogic.com Subject: cts:element-value-match for integers Hi everyone, Can someone explain how does cts:element-value-match work with intege