Marklogic mlcp and optic query

122 views Asked by At

Hi I am able to push data into MarkLogic using mlcp but on doing an optic query I get null as result. How can I receive a result from an optic query after pushing the data using mlcp and even after adding the schema? Or how do I map the schema with the mlcp pushing data?

Data loaded with this MLCP command:

mlcp.sh import -host localhost -port 8000 -username admin -password admin -input_file_path C:\Users\sehajpalsinghj\Documents\DPHMJSOn\csv\1.csv -input_file_type delimited_text -document_type json -mode local -output_collections test

1

There are 1 answers

0
Dave Cassel On

Are you using TDE to get information from the documents into the index? Assuming so, your TDE template must specify the context (a path in the document) and may specify one or more collections. Since you're using MLCP to generate JSON documents from CSV, you will have very flat JSON: all the properties will be part of the root object. Specify one of those properties as the context. Use the tde.nodeDataExtract function to verify that the template is extracting from the documents what you think it should be extracting -- do this before trying to do anything with Optic.

Assuming you are using TDE, I highly recommend you read all the way through the Template-Driven Extraction tutorial.