Hi, Gnanaprakash:
The best approach might be to write a resource service extension that does
steps 2 through 4 as one request. Then, when the ingestion request finishes,
do step 5 as a standard REST search request.
That way, the ingested documents will be available to all searchers at the
earliest possible time and you won't have to use an eval to put the document
inserts and search in separate transactions.
The details about writing a resource service extension are explained here:
http://docs.marklogic.com/guide/rest-dev/extensions
If you need to ingest a large number of documents, you might need to ingest
batches of documents in separate transactions. InfoStudio collectors and the
infodev:transaction() function can be helpful for that task. In particular,
the collector-feed.xqy collector could be a model for an approach that _might_
work for you:
https://github.com/marklogic/infostudio-plugins/tree/master/collectors
If you need to ingest document batches asynchronously, the client might need to
poll the server (checking the ticket status, if you're using the InfoStudio
functions) to determine whether ingestion is complete.
Erik Hennum
________________________________
From: [email protected]
[[email protected]]
Sent: Monday, January 28, 2013 2:10 AM
To: [email protected]; Erik Hennum
Subject: Using ML6 Rest-API with dependancy on other services
Hi Erik,
I am having a requirement to Search based on
1. Rest API Call --> 2. Call an external service --> 3. Get Results -->
4. Ingest transformed document --> 5. Perform Rest API Search
Note: the search will be effected drastically based on step 4 (sometimes based
on condition steps 2 to 4 will be optional)
Previously, I am using Corona and I have tweaked Corona to handle this case.
But, as I got suggestions not to tweak the Rest API modules is there any other
way where I can achieve the above process?
Thanks in Advance :)
Thanks and Regards,
Gnanaprakash Bodireddy
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient(s), please reply to the sender and
destroy all copies of the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email,
and/or any action taken in reliance on the contents of this e-mail is strictly
prohibited and may be unlawful.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general