我是 Marklogic 的新手,我尝试将 100k 记录的 CSV 文件导入 Marklogic,导入后,我发现它默认导入到文档数据库。另外,我发现对于每条记录,我都会看到数据库中生成的 XML 文件,其中增量编号附加到我在导入时提到的“documentUri”。例如:documentUri_1.xml。据我了解,创建多个 xml 文件是为了以分布式方式读取数据。
Question: 1. How to get the root document URI for this document? which has multiple xml files? Question: 2. How do i import the same CSV file to a different database?
Question: 3. When I use xquery to list all documents in the database, I am getting all the all xml files URI rather just the dummy.xml uri? How do I achieve this?
注意:我使用以下命令进行导入:
mlcp.bat import -host localhost -port 8000 -username admin -password admin -input_file_path dummy.csv -mode local -input_file_type delimited_text -uri_id 'dummy.xml'
有人能帮我解决这个问题吗?
最佳答案
问题 1) 不存在“根文档”这样的东西。每个文档都是独立的。但您可以按集合将文档分组在一起(见下文)。
问题 2) 使用 -database mlcp 选项。
问题 3)我认为您正在寻找 mlcp 选项 -filename_as_collection 。这将允许您通过以文件命名的集合查找文档。例如,在 XQuery 中:
collection("dummy.csv")
关于xml - Marklogic : Multiple XML files created on document on importing a csv. 如何获取根文档URI路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36698593/