What I am talking about is the "range value position" setting in the range 
index configuration (it is the last setting, below collation).  It defaults to 
false.  Try setting it to true to see if it helps  to resolve that query.

From: [email protected] 
[mailto:[email protected]] On Behalf Of DJaun Maclin
Sent: Thursday, July 14, 2011 10:36 AM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] filter cts:element-values by attribute

Thanks, Danny but the ranges are set correctly otherwise the function would 
give me an error for trying to use ranges that have not been set. It seems like 
something really simple to say only take these if the attribute matches this 
value, but I can't find it anywhere.

Thanks again

Dj

________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of Danny Sokolsky
Sent: Thursday, July 14, 2011 12:31 PM
To: General MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] filter cts:element-values by attribute

Hi DJ,

I am not sure, but you might need positions on the attribute range index for 
Lookup @ minorTYpe.  You can set that in the range index dialog in the Admin 
Interface.  See if that helps.

Also, I think you can simplify your query by removing the "let $count" and 
changing the order by to:

order by cts:frequency($i) descending

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of DJaun Maclin
Sent: Thursday, July 14, 2011 9:39 AM
To: [email protected]
Subject: [MarkLogic Dev General] filter cts:element-values by attribute

Hi everyone,

let $facet := cts:element-values(xs:QName("Lookup"), "", ("item-frequency", 
"collation=http://marklogic.com/collation/en/S1/AS/T0020";), 
cts:element-attribute-range-query(xs:QName("Lookup"),xs:QName("minorType"),"=","scientificTags",('collation=http://marklogic.com/collation/en/S1/AS/T0020')))
return
for $i in $facet
let $count := cts:frequency($i)
where fn:not(fn:replace($i, ' ','') = '')
order by $count descending
return $i

The above code returns everything with the element "Lookup," but how can I 
filter based on if the attribute, "minorType" equals the word "scientificTags"?

Thanks in advance
Dj

Djaun Maclin
Product Manager
WATT Knowledge * Solutions * Success
Office: 815-966-5539
Mobile: 815-608-7653
Email: [email protected]<mailto:[email protected]>
Web: www.wattnet.com<http://www.wattnet.com>

This e-mail and any attachment may contain confidential and privileged material 
intended for the addressee only. If you are not the addressee, you are notified 
that no part of the e-mail or any attachment may be disclosed, copied or 
distributed, and that any other action related to this e-mail or attachment is 
strictly prohibited, and may be unlawful. If you have received this e-mail by 
error, please notify the sender immediately by return e-mail, and delete this 
message. WATT Publishing Co. and/or its employees shall not be liable for the 
incorrect or incomplete transmission of this e-mail or any attachments, nor 
responsible for any delay in receipt.

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to