Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MarkLogic - Make CPF run on every ingested document where the URIs are "name.xml" with no directories or slashes

Tags:

marklogic

We need to add a collection to every document we ingest and would like to use CPF as the collection will depend on data in the documents.

Our document URIs are: GUID.xml no forward-slash or directory in front of them.

We have attempted to get CPF to trigger using:

document scope = directory

uri = /

and

document scope = document

uri = /

Our theory is that CPF is expecting the document URIs to begin with a forward-slash but since they do not CPF is not triggering.

We have considered using a crude solution of adding a basic collection to every document and using that as the document scope for CPF, but obviously this is unnecessary data being added which we don't need.

We would be grateful for any ideas or solutions.

like image 789
zrdunlap Avatar asked May 26 '16 14:05

zrdunlap


1 Answers

I found this in the Domain Scope section of the CPF Guide:

In the Admin Interface, the document scope drop-down list specifies whether the domain applies to a single document, a directory, or a collection. Each domain can only have one of these document scopes; if you need more than one of these document scopes, you can create multiple domains.

In other words, to use CPF on more than one document, you'll need to use either directories or a collections to organize your data a bit.

Also note that the CPF guide says "Do not overlap domains". This means that if you ever wanted CPF to target content more precisely, you'll want a more specific organization of your content anyway (different directories for different types or sources of content, for instance). This can also be helpful during searches. Without knowing anything about your data, I can't suggest how you might break it up, but some kind of organization is typically helpful.

You'll need to do something different in your data load. I think your path of least resistance is to add a / to the beginning of your URIs.

like image 187
Dave Cassel Avatar answered Sep 28 '22 01:09

Dave Cassel