I was having a tough time following this question, so I tried to construct a similar test case. I tested in cq, using MarkLogic Server 5.0-1.
xdmp:document-insert( 'test-1.xml', element doc { element e1 { attribute a1 { 1 } }, element e2 { attribute a1 { 1 } } }), xdmp:document-insert( 'test-2.xml', element doc { element e2 { attribute a1 { 'foo' } }, element e2 { attribute a1 { 'bar' } } }) => () for $v in cts:element-attribute-values( xs:QName(('e1', 'e2')), xs:QName('a1'), (), ("collation=http://marklogic.com/collation/", "fragment-frequency"), cts:and-query( (cts:element-query(xs:QName('e1'), cts:and-query(())), cts:element-query(xs:QName('e1'), cts:and-query(()))))) return text { $v, cts:frequency($v) } => 1 2 That value looks right to me. The frequency is questionable, and I can't decide if it's correct or not. There is only one fragment that contains that attribute value. On the other hand, that element-attribute value occurs in two lexicons: e1-a1 and e2-a1. On the whole I lean toward calling it a bug, though: the option is 'fragment-frequency' not 'lexicon-fragment-frequency', and both lexicon values come from the same fragment. Assuming I've reconstructed your problem, I'd suggest contacting support. They may find that it is a bug, or they can create an RFE for some future version of the server to do what you want. -- Mike On 7 Dec 2011, at 02:36 , Abhishek53 S wrote: > > Hi Folks, > > I am having some issue with fragments frequency when I am using multiple > Qname in the element-attribute-values query > > I put some sample query below > > for $value in cts:element-attribute-values( > (xs:QName("element1"),xs:QName("element2")), > xs:QName("code"), > (), > > ("collation=http://marklogic.com/collation/","fragment-frequency"), > $query) > > > return <item> > <name>{$value}</name> > <count>{cts:frequency($value)}</count> > </item> > > > <!-- > Result XML structure > > <report> > <element1 code="codeX"/> > <element2 code="codeX"/> > </report> > > --> > > There is only one search result matching $query, having two elements -- > element1 and element2. Both having the same attribute code ="codeX" [as per > sample XML structure]. when I am using cts:frequency to count the no of > fragments matching the query it is returning codeX with count 2. Though it is > expected to be 1 since both the elements attribute value are present in the > same document. > > Let me know if I am missing something. > > Thanks > Abhishek Srivastav > Systems Engineer > Tata Consultancy Services > Cell:- +91-9883389968 > Mailto: abhishek5...@tcs.com > Website: http://www.tcs.com > ____________________________________________ > Experience certainty. IT Services > Business Solutions > Outsourcing > ____________________________________________ > =====-----=====-----===== > Notice: The information contained in this e-mail > message and/or attachments to it may contain > confidential or privileged information. If you are > not the intended recipient, any dissemination, use, > review, distribution, printing or copying of the > information contained in this e-mail message > and/or attachments to it are strictly prohibited. If > you have received this communication in error, > please notify us by reply e-mail or telephone and > immediately and permanently delete the message > and any attachments. Thank you > > > _______________________________________________ > General mailing list > General@developer.marklogic.com > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general