Hi Paul, I’d do a lexicon lookup on elemX using cts:values, and then use that for a not-query(range-query(elemZ, ‘=‘, elemXvalues)).
Note that range-query(elemZ, ‘!=‘, elemXvalues) it not equivalent. That would return true if there is at least one value in elemXvalues not equal to elemZ, which is probably not what you are looking for.. Kind regards, Geert From: <[email protected]<mailto:[email protected]>> on behalf of Paul M <[email protected]<mailto:[email protected]>> Reply-To: Paul M <[email protected]<mailto:[email protected]>>, MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Monday, May 22, 2017 at 5:11 PM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] Matching on not equal using indexes Greetings. Three documents, A, B, C. Each contains two elements, elemZ, elemX. Both elements have range index. Could the below be found with index only? A elemZ=35 elemX=35 B elemZ=36 elemX=30 C elemZ=20 elemX=35 Q1. All docs that have elemZ >= 30 elem range query with (elemZ, ">=", 30) will return doc A and doc B Q2. All docs that have elemZ > 30 AND elemZ != elemX. Current solution elem range query >= thirty using index then for loop to look in doc to see elemZ does not equal elemX Any way not looking in doc? Q3. All docs that have elemZ != elemX Could this be solved using indices?
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
