Я реализую основанную на объектах структуру интеллекта на MarkLogic, и я не вижу, какой индекс мне сейчас не хватает.создавать объекты с ошибкой ELEMRIDXNOTFOUND
Я создал объекты и использовал расширение для восстановления объектов из (датчиков) данных, попавших в конечную точку.
Журнал сервера говорит:
2015-08-17 15: 46: 41,763 Информации: cluey-приложение: Статус 500: XDMP-ELEMRIDXNOTFOUND: ЦТС: элемент-значение (хз: QName (» obj: id "),(), " collation = http://marklogic.com/collation/codepoint ", cts: and-query ((cts: collection-query (" object "), cts: element-range-query (xs: QName (" obj : тип ")," = "," датчик ", (" collation = http://marklogic.com/collation/ "), 1), cts: element-range-query (xs: QName (" scc: id ")," = ", xs: untypedAtomic ("rb-0041"),(), 1)),())) - Нет диапазона строковых элементовиндекс {http://marklogic.com/solutions/obi/object} типа http://marklogic.com/collation/
Блочный код, который пытается создать объекты заключается в следующем:
xquery version "1.0-ml";
import module namespace obj = "http://marklogic.com/solutions/obi/object" at
"/ext/obi/lib/object-service-lib.xqy",
"/ext/obi/lib/object-lib.xqy";
declare namespace sight= "http://klpd.nl/sight";
declare namespace scc= "http://sensingclues.com/sccs";
declare variable $source-id external;
declare variable $result external;
declare variable $merge external;
for $object in $result/objects/element()
let $type := obj:get-type-from-content($object)
let $existing-object :=
if ($merge) then
cts:element-values(xs:QName("obj:id"),(), ("collation=http://marklogic.com/collation/codepoint"), cts:and-query((
cts:collection-query("object"),
obj:type-query($type),
cts:element-range-query(xs:QName("scc:id"), "=", $object//scc:id)
)))[1]
else()
let $object-id :=
if ($existing-object) then
let $detail-id := obj:add-details($existing-object, $object, $source-id,()) (:hk empty workspace-id:)
return $existing-object
else
obj:create-object($object, $source-id)[1]
return <result id="{$object-id}" type="{$type}"/>
', (xs:QName('source-id'), $source-id, xs:QName('result'), $result, xs:QName('merge'), $merge),
<options xmlns="xdmp:eval"><isolation>different-transaction</isolation></options>)
Индексы в мл-конфигурации для этой конкретной задачи добавленной являются:
<!-- Cluey specific indexes -->
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://sensingclues.com/sccs</namespace-uri>
<localname>id</localname>
<collation>http://marklogic.com/collation/</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://sensingclues.com/sccs</namespace-uri>
<localname>source</localname>
<collation>http://marklogic.com/collation/</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://sensingclues.com/sccs</namespace-uri>
<localname>timestamp</localname>
<collation>http://marklogic.com/collation/</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
Вопрос:
Какой индекс мне не хватает? Я использую неправильную точку сопоставления?
EDIT:
все остальные индексы диапазона элементов в мл-config.xml:
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://marklogic.com/solutions/obi/source</namespace-uri>
<localname>dataset</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://purl.org/dc/terms/</namespace-uri>
<localname>title</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://marklogic.com/solutions/obi/object</namespace-uri>
<localname>label</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://marklogic.com/solutions/obi/object</namespace-uri>
<localname>type</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://marklogic.com/solutions/obi/ontology</namespace-uri>
<localname>objectDefDirectory</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
<range-element-index>
<scalar-type>dateTime</scalar-type>
<namespace-uri>http://marklogic.com/solutions/obi/source</namespace-uri>
<localname>contentDateTime</localname>
<collation></collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
EDIT РЕШЕНИЕ
Отсутствует индекс и сверка
<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://marklogic.com/solutions/obi/source</namespace-uri>
<localname>id</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-element-index>
Можете ли вы сказать мне, где это? obj: type-query ($ type), возможно, отсутствует индекс типа? – Thijs
in ext/obi/lib/object-lib.xqy –