Meghan Noonan
Meghan Noonan

Reputation: 21

Using the -output_uri_replace option

I am loading JSON documents into a MarkLogic database through MLCP. My input file is a line delimited JSON file. By default my URI is taking the form of path/filename/split_start_seqnum. I would like to instead have the URI contain the values of two of the elements for a particular document.

For example, each document represents a restaurant and there are elements such as restaurant_name, restaurant_zip, restaurant_hours, etc. I'd like the URI to be some combination of restaurant_name and restaurant_zip. How do I code that in a MLCP script?

Upvotes: 1

Views: 266

Answers (1)

grtjn
grtjn

Reputation: 20414

The -output_uri_replace can be useful to make more static changes to the uri with regex patterns, but doesn't allow pulling values from content. Best approach for this would be to use MLCP Transforms.

This SO answer provides an example, and some pointers to documentation:

Using Transform Module during MLCP Ingestion to MarkLogic

HTH!

Upvotes: 0

Related Questions