Hi Curtis, It does seem like you are set up correctly.
Another possibility: the system might not realize that you need to reindex. Have you tried doing a forced reindex (Database > db-name > reindex button)? Or tried creating that index in its own form in the Admin UI? -Danny From: [email protected] [mailto:[email protected]] On Behalf Of Curtis Wilde Sent: Tuesday, March 29, 2011 8:32 AM To: General MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] XDMP-ELEMATTRRIDXNOTFOUND Even when index is present. I deleted and regenerated indexes on my database last night. Running your code results in: <range-element-attribute-index xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://marklogic.com/xdmp/database"> <scalar-type>string</scalar-type> <parent-namespace-uri/> <parent-localname>book chapter letter attachment magazine section article subArticle figureBlock topicBlock formBlock tocBlock tocEntry</parent-localname> <namespace-uri/> <localname>fileID</localname> <collation>http://marklogic.com/collation/</collation> <range-value-positions>false</range-value-positions> </range-element-attribute-index> true <forest-counts xmlns="http://marklogic.com/xdmp/status/forest"> <forest-id>13183896498716641639</forest-id> <forest-name>Creation</forest-name> <current-time>2011-03-29T09:28:20.935-06:00</current-time> <stands-counts> <stand-counts> <stand-id>621410745842281759</stand-id> <path>C:\Program Files\MarkLogic\Data\Forests\Creation\00001ccd</path> <active-fragment-count>884349</active-fragment-count> <nascent-fragment-count>0</nascent-fragment-count> <deleted-fragment-count>47198</deleted-fragment-count> </stand-counts> <stand-counts> <stand-id>1933560585328485115</stand-id> <path>C:\Program Files\MarkLogic\Data\Forests\Creation\00001cd3</path> <active-fragment-count>36844</active-fragment-count> <nascent-fragment-count>0</nascent-fragment-count> <deleted-fragment-count>0</deleted-fragment-count> </stand-counts> <stand-counts> <stand-id>247144415692164686</stand-id> <path>C:\Program Files\MarkLogic\Data\Forests\Creation\00001cd8</path> <active-fragment-count>15846</active-fragment-count> <nascent-fragment-count>0</nascent-fragment-count> <deleted-fragment-count>0</deleted-fragment-count> </stand-counts> </stands-counts> <document-count>368789</document-count> <directory-count>18693</directory-count> </forest-counts> <error:error xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd" xmlns:error="http://marklogic.com/xdmp/error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <error:code>XDMP-ELEMATTRRIDXNOTFOUND</error:code> <error:name/> <error:xquery-version>1.0-ml</error:xquery-version> <error:message>No element-attribute range index</error:message> <error:format-string>XDMP-ELEMATTRRIDXNOTFOUND: cts:element-attribute-values(fn:QName("", "article"), fn:QName("", "fileID"), cts:element-query(fn:QName("", "article"), cts:document-query("/myfile.xml"), ())) -- No element-attribute range index for fn:QName("", "article") fn:QName("", "fileID") http://marklogic.com/collation/</error:format-string> <error:retryable>false</error:retryable> <error:expr>cts:element-attribute-values(fn:QName("", "article"), fn:QName("", "fileID"), cts:element-query(fn:QName("", "article"), cts:document-query("/myfile.xml"), ()))</error:expr> <error:data> <error:datum/> <error:datum>fn:QName("", "article")</error:datum> <error:datum>fn:QName("", "fileID")</error:datum> <error:datum>http://marklogic.com/collation/</error:datum> </error:data> <error:stack> <error:frame> <error:line>1</error:line> <error:operation>xdmp:eval("cts:element-attribute-values( xs:QName(&quot;article&quot;), xs:...", (), <options xmlns="xdmp:eval"><database>15486952774056841465</database></options>)</error:operation> <error:xquery-version>1.0-ml</error:xquery-version> </error:frame> <error:frame> <error:line>20</error:line> <error:operation>xdmp:eval("xquery version &quot;1.0-ml&quot;;&#13;&#10; &#13;&#10;import mo...", (), <options xmlns="xdmp:eval"><root>C:\JungleDisk\dev\marklogic\workspace\CCC</root><isolation...</options>)</error:operation> <error:xquery-version>1.0-ml</error:xquery-version> </error:frame> <error:frame> <error:uri>/cq2/eval.xqy</error:uri> <error:line>111</error:line> <error:xquery-version>1.0-ml</error:xquery-version> </error:frame> </error:stack> </error:error> On Mon, Mar 28, 2011 at 6:05 PM, Danny Sokolsky <[email protected]<mailto:[email protected]>> wrote: Hi Curtis, It does appear that everything is set up correctly. Is it possible that you are looking at the config entry for the wrong db, or that reindexing did not actually happen (even though you thought it did)? Try running the following to make sure—this will get the attribute range index setting for that db, the forest counts (which will show you if it needs reindexing), and will run that query on the same db—just change the variable name to the name of your databse: xquery version "1.0-ml"; import module namespace admin= "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; (: put your dbname here :) declare variable $dbname := "Documents"; let $config := admin:get-configuration() return (admin:database-get-range-element-attribute-indexes($config, xdmp:database($dbname) ), admin:database-get-reindexer-enable($config, xdmp:database($dbname)) ), xdmp:forest-counts(xdmp:database-forests( xdmp:database($dbname))) , try { xdmp:eval('cts:element-attribute-values( xs:QName("article"), xs:QName("fileID"), cts:element-query( xs:QName( "article" ), cts:document-query( "/myfile.xml") ) )', (), <options xmlns="xdmp:eval"> <database>{xdmp:database($dbname)}</database> </options>) } catch ($e) { $e } -Danny From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Curtis Wilde Sent: Monday, March 28, 2011 4:06 PM To: General MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] XDMP-ELEMATTRRIDXNOTFOUND Even when index is present. The article I'm trying to find with the query has no special namespaces. Here is the root element: <?xml version="1.0" encoding="UTF-8"?> <article fileID="00000_000_000" guid="7422da50-4e22-48c7-aaf1-ae0c66a8c030" xml:lang="eng" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> The xml definition of the element-attribute-range-index was queried directly from the database, so yes, the names of the attribute, element and the collation are exactly as reported in my first email, and match the document above (unless I'm missing something). Re-indexing was done a couple of days ago during the weekend, so the problem shouldn't be that I'm waiting for indexing operations to finish, though I may destroy the index and try again, just to be safe. On Mon, Mar 28, 2011 at 4:37 PM, Stewart Shelline <[email protected]<mailto:[email protected]>> wrote: Do the elements in question have a namespace? If so, you will need to provide it in the element-attribute range configuration of the admin console as well as in the options of the query. Also, does the collation specified in the admin console match the collation you specify below (http://marklogic.com/collation/)? From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Curtis Wilde Sent: Monday, March 28, 2011 4:30 PM To: General Mark Logic Developer Discussion Subject: [MarkLogic Dev General] XDMP-ELEMATTRRIDXNOTFOUND Even when index is present. I'm trying to perform a search, and I know I have an index in place (see below), but it returns an exception saying that the index is not found. This also happens after re-indexing my database. Windows 7x64, MarkLogic 4.2-3.2 <range-element-attribute-index xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://marklogic.com/xdmp/database"> <scalar-type>string</scalar-type> <parent-namespace-uri/> <parent-localname>book chapter letter attachment magazine section article subArticle figureBlock topicBlock formBlock tocBlock tocEntry</parent-localname> <namespace-uri/> <localname>fileID</localname> <collation>http://marklogic.com/collation/</collation> <range-value-positions>false</range-value-positions> </range-element-attribute-index> let $uri := "/myfile.xml" return cts:element-attribute-values( xs:QName("article"), xs:QName("fileID"), cts:element-query( xs:QName( "article" ), cts:document-query( $uri) ) ) [1.0-ml] XDMP-ELEMATTRRIDXNOTFOUND: cts:element-attribute-values(fn:QName("", "article"), fn:QName("", "fileID"), cts:element-query(fn:QName("", "article"), cts:document-query("/myfile.xml"), ())) -- No element-attribute range index for fn:QName("", "article") fn:QName("", "fileID") http://marklogic.com/collation/ NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
