【发布时间】:2018-05-16 14:12:02
【问题描述】:
我会尝试在 SOLR 上放置一个 xml 文档(现在我使用的是 7.3.0 版本),而不在 data-config 中设置特定字段或放置一个标签来获取所有其他标签。我尝试使用无模式模式,但没有得到任何文档。有没有可能以某种方式来做这件事,还是SOLR处理不了?
这是我的 SOLR document.xml 的一个示例。我想检测所有标签并取回相对值而不编辑任何字段。就像我说的,我尝试了无模式模式,但它不起作用。
<?xml version="1.0" encoding="UTF-8"?>
<digital_archive xmlns="https://www.site" dataCreazione="2017-05-11T17:15:00">
<DocumentalCategory>some data</DocumentalCategory>
<customer>some data</customer>
<producer>some data</producer>
<documentOwner>some data</documentOwner>
<sources>
<source>
<idc>
<id scheme="adfr">some data</id>
<name>some data</name>
<path>sources\source\some_path.XML</path>
<hash alg="SHA-256">3748738</hash>
</idc>
<vdc>
<id scheme="some data">some data.XML</id>
<timeReference>2017-03-17T14:19:01+0100</timeReference>
</vdc>
</source>
</sources>
<ud>
<metadati>
<Name>Jane</Name>
<Surname>Doe</Surname>
<FiscalCode>dsrsd6w7hedw</FiscalCode>
<Date>29.10.2017</Date>
</metadati>
我期望的结果是这样的:
<field name="DocumentalCategory">some data</DocumentalCategory>
<field name="customer">some data</customer>
<field name="producer">some data</producer>
<field name="documentOwner">some data</documentOwner>
<field name="sources">
<field name="source">
<field name="idc">
<field name="id" scheme="adfr">some data</id>
<field name="name">some data</name>
<field name="path">sources\source\some_path.XML</path>
【问题讨论】:
-
你想如何处理 XML 结构?
-
我只是编辑我的问题。
-
你可以在运行索引后尝试 curl localhost:8983/solr/collectionName/schema/fields
-
这是我的 Json 响应:{ "status":0, "QTime":4}, "fields":[{ "name":"root", " type":"string", "docValues":false, "indexed":true, "stored":false}, { "name":"text", "type":"text_general", "multiValued":true, "indexed":true, "stored":false}, { "name":"version", "type":"plong", "indexed":false, "存储”:假},{“名称”:“id”,“类型”:“字符串”,“多值”:假,“索引”:真,“必需”:真,“存储”:真}]}
-
当我发布 xml 文件时,Solr 接受它,但响应为空。
标签: xml solr dataimporthandler data-import schemaless