0

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

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
  • I'd start with checking document permissions of what you imported with MLCP. One typically runs that with some admin user, and it is easy to forget to apply `-output_permissions`. See here how to use that parameter: https://stackoverflow.com/a/46058091/918496 – grtjn Sep 11 '17 at 07:40
  • Have you confirmed that the TDE template matches a sample document? – ehennum Sep 11 '17 at 23:41
  • Can you provide the optic query you're running and a sample document or two? There's not much we can do without those. – Dave Cassel Sep 12 '17 at 15:29
  • 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 – SehajJaggi Sep 18 '17 at 06:57
  • also refer this link for the better understanding of the question https://stackoverflow.com/review/suggested-edits/17363273 – SehajJaggi Sep 18 '17 at 06:59
  • am i missing anything in the mlcp command so as to link it with the schema @DaveCassel – SehajJaggi Sep 18 '17 at 07:12

1 Answers1

0

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.

Dave Cassel
  • 8,352
  • 20
  • 38