1

I use ml-gradle to define my database. I want to use a path-range-index with namespace on elements and attributes.

All works well when I define the path namespace in the admin console, but the path-namespace aren't created when I configure it in the json defining the database :

 "uri-lexicon": true,
 "path-namespace" : [
      {
          "prefix": "h",
          "namespace-uri": "http://www.w3.org/1999/xhtml"
      }
  ],
  "range-path-index": [
    {
      "scalar-type": "string",
      "path-expression": "//h:a[@class = 'els-include']/@href",
      "collation": "http://marklogic.com/collation/codepoint",
      "range-value-positions": false,
      "invalid-values": "reject"
    }
  ]

In the traces of gradle I see that the namespace definition aren't included in the JSON sent:

      "database-name" : "test",
      "triple-index" : true,
      "collection-lexicon" : true,
      "uri-lexicon" : true,
      "range-path-index" : [ {
        "scalar-type" : "string",
        "path-expression" : "//h:a[@class = 'els-include']/@href",
        "collation" : "http://marklogic.com/collation/codepoint",
        "range-value-positions" : false,
        "invalid-values" : "reject"
      } ]
    } ]

I tested with the last version of ml-gradle: 4.5.2 Has anyone used this in ml-gradle?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
  • 1
    Hi - I just tried that out by adding those 3 items - uri-lexicon, path-namespace, and range-path-index - to a content-database.json file. I verified that running either "mlDeploy" or "mlDeployDatabases" correctly deployed the database, and the "-i" logging shows those 3 items properly included in the payload. What command did you run? And can you share all of your database file? – rjrudin May 19 '23 at 18:46
  • As @rjrudin requested, please share the complete config and trace. Sometimes the order of `path-namespace` could be different from the database-config. Are you seeing `mlDeploy` failing (OR) passing but path-namespace/index missing in your DB (OR) everything is working as expected, only the trace is wrong? – P K May 19 '23 at 19:39
  • Sorry for the delay, but I was in holidays! The problem is that in xslt, when you use the path range index, you have to declare the namespace at the group level and not at the database. So it's not a gradle problem, I had the namespace declaration in the group configuration in the gradle ml-config and all is ok! As I use the path-nameindex in XQuery and XSLT, I do a misinterpretation – Marc Messéant Jun 21 '23 at 13:55

0 Answers0