Reputation: 43
How we can get local path of documents in MarkLogic? Is there any XQuery or Java method to get local path of document?
For example: I have exported few documents from my local D drive into MarkLogic. In feature if I want to fetch local path from MarkLogic.
I have installed MarkLogic server in the following path C:\Program Files\MarkLogic\data. Will it store this information anywhere in this path?
I am not able to find any data related to document in this forest location?
Upvotes: 0
Views: 494
Reputation: 6651
When documents are ingested into a MarkLogic database they are stored in a proprietary binary format, along with its index entries, on disk in one of the of the forests associated with that database.
The default location on Windows for forests is
C:\Program Files\MarkLogic\Data\Forests
The default location on Linux for forests is
/var/opt/MarkLogic/Forests
The way the documents are tracked is by URI, which can look similar to a disk path, but is not associated with any particular disk location. If you want to determine the particular forest that the document is stored in you can take the URI and use xdmp:document-forest with xdmp:forest-name to find the forest name.
xdmp:forest-name(xdmp:document-forest("/my/uri/path/example.xml"))
MarkLogic offers free self-paced, and free instructor-led training, and I would suggest starting with the MarkLogic Fundamentals course, as it will cover some of these concepts.
Upvotes: 3