My <collection> element was not in the search namespace. This was a side effect 
of cutting and pasting from various examples where a default namespace had been 
set.

Hmph.

Cheers,

E.

--
Eliot Kimber
http://contrext.com
 


On 8/7/17, 9:55 PM, "[email protected] on behalf of Eliot 
Kimber" <[email protected] on behalf of 
[email protected]> wrote:

    This is ML 8.0-3.2
    
    Cheers,
    
    E.
    --
    Eliot Kimber
    http://contrext.com
     
    
    
    On 8/7/17, 9:45 PM, "[email protected] on behalf of 
Eliot Kimber" <[email protected] on behalf of 
[email protected]> wrote:
    
        I’m trying to do a search:search() with two contraints: one for 
collection and one for a bucketed facet. 
        
        Here is my search definition:
        
        search:search(("install"),
        <search:options>
          <search:constraint name="trial">
            <collection prefix="/profiling/" facet="true"/>
            <facet-option>limit=5</facet-option>
          </search:constraint>
          <search:constraint name="elapsed-time">
            <search:range type="xs:dayTimeDuration" facet="true">
              <search:bucket lt="PT0.01S" 
                name="100th">100th of a second</search:bucket>
              <search:bucket ge="PT0.01S" lt="PT0.02S"
                name="2-100th">200th of a Second</search:bucket>
             … (bunch of buckets omitted)
              <search:bucket gt="PT2S"
                name="gt2s">More than 2 seconds</search:bucket>
              <search:element ns="http://marklogic.com/xdmp/query-meters";
                 name="elapsed-time"/>
            </search:range>
          </search:constraint>
        </search:options>)
        
        I can’t see any problem with this definition and if I run it as shown 
it works and my bucket constraint result is good (very nice, by the way).
        
        However, If I try to specify a value for the named constraint “trial:”, 
e.g.:
        
        search:search(("install and trial:trial-001"), …)
        
        Then I get this failure:
        
        [1.0-ml] XDMP-AS: (err:XPTY0004) $constraint-elem as element() -- 
Invalid coercion: () as element()
        Stack Trace
        
        In /MarkLogic/appservices/search/ast.xqy on line 305
        In ast:joiner-constraint(map:map(<map:map 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:map="http://marklogic.com/xdmp/map";><map:entry key="toknum"><map:value 
xsi:type="xs:unsignedLong">6<...</map:map>...XDMP-ATOMIZEFUNC: (err:FOTY0013) 
Functions cannot be atomized...), <search:term-query 
xmlns:search="http://marklogic.com/appservices/search";><search:text>trial</search:text></search:term-query>)
        
        (and lots more stack trace items).
        
        What is causing this failure and what do I do to resolve it?
        
        Thanks,
        
        Eliot
        --
        Eliot Kimber
        http://contrext.com
         
        
        
        
        _______________________________________________
        General mailing list
        [email protected]
        Manage your subscription at: 
        http://developer.marklogic.com/mailman/listinfo/general
        
    
    
    _______________________________________________
    General mailing list
    [email protected]
    Manage your subscription at: 
    http://developer.marklogic.com/mailman/listinfo/general
    


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

Reply via email to