Can I update metadata only with updatedocument API? - ibm-watson

I'd like to update document's metadata only without re-uploading document itself.
So, I use updateDocument API without "File" parameter to update metadata only, but unfortunately enrich data is gone. (metadata is successfully updated!).
Is this updatedocument api's spec?
If I want to update metadata. Do I need upload document itself?
https://watson-api-explorer.ng.bluemix.net/apis/discovery-v1#!/Documents/updateDocument

Unfortunately, Discovery does not support updating only the metadata.
As you speculate, you do need to re-upload the document itself, along with the new or updated metadata that you want.
This documentation says:
Update a document
Replace an existing document. Starts ingesting a document with optional metadata.
which I can see may not be completely clear. By saying Replace an existing document it is trying to convey that the existing document is always and completely replaced.

Related

How to manually create JSON object for GMail API ('Message' object)

I'm trying to create a system for creating and sending emails through the GMail API. I have gotten a receive workflow working (Oauth, retrieves and parses emails). So I have seen the 'Message' JSON objects that Google uses.
Now I want to send out a 'Message' that was created by my system. So I'm looking for information about what is the minimal or basic set of elements needed to create a valid 'Message' object for Google's GMail API.
My platform is using FileMaker Pro... so I can't really use any existing library for their templates and functions. I am looking to build the JSON object directly, with text functions.
I have seen the GMail API documentation. It doesn't really seem to clarify what is required or optional. One side point: Message ID - it doesn't describe the parameters for that. Can I set it to anything I want? Is that something only generated as a PK for Google's own database to store it under? (Apparently it's not required, as it seems it will be defined and returned in the Send response.)
I note that it has the 'Raw' element... maybe it's simpler to build the RFC 2822 text from a template of some sort, doing targeted replacements? It still is a matter of - what's minimally needed in the template? (Would eventually like to be able to send attachments, too.) And it seems that building a JSON object version would be more readable, maintainable, and/or robust.
Thanks,
J

Update Solr with Nifi

I have a Nifi workflow which retrieves a URL from Solr and calculates the share count of this URL on different social media's, I need to update this share count back on Solr, the two attributes in the flowfile are the url and the respective sharecount, how can I do the update back to solr with Nifi.
You can use the PutSolrContentStream processor to insert a new document into Solr, or overwrite one that is there. There currently isn't support for partial updates, so if you were trying to update a document that was already there, then you need to have the entire original document in NiFi + the updates, so you can send the whole document back in.
PutSolrContentStream can basically do any of the updates described here:
https://lucene.apache.org/solr/guide/6_6/uploading-data-with-index-handlers.html
The default approach is to create a JSON document in NiFi and send that to the JSON update handler.

Can I bulk load documents with inline attachments to Cloudant?

I want to bulk load a set of documents into a Cloudant DB. Cloudant provides a REST endpoint for this, _bulk_docs. But some of the documents I want to load contain attachments. If I were creating these documents individually, I could create the attachment along with the document by including it as an inline attachment. But it's not clear whether the _bulk_docs endpoint supports documents with inline attachments. The documentation does not say one way or the other, and my own attempts are so far unsuccessful.
Can someone please give an authoritative answer on whether the _bulk_docs endpoint of Cloudant supports docs with inline attachments?
The _bulk_docs endpoint does support docs with inline attachments.
I finally got this to work. My earlier attempts failed due to an unrelated problem. I was able to successfully bulk load 51 documents, 14 of which have inline attachments.

Liferay document checkin issue

I'm still new to Liferay and using Liferay 6.2
what i'm doing:
I am trying to add a document manually into my database using insert statement.
I inserted into dlfileentry, dlfileversion and AssertEntry.
Also, i created a folder with the valid name and file.
The issue:
upon entering the Documents and Media portlet, i can see the document name there but when i click on checkout, it will prompt a error saying that Documents and Media is temporarily unavailable. however i am still able to download the valid document.
Am i doing something wrong? Personally, i feel that i am missing one more table for the database but i'm not sure .
Thanks!
Yes, you're doing something wrong: You should never write to Liferay's database with SQL, as there might be more data required than what's directly visible to you. Obviously, you're running into exactly such an issue.
Liferay has an API which you can use locally, from within the same application server, or remotely as JSON or SOAP service. You should exclusively use this for write access to the database.
Alternatively, you might consider WebDAV access to your document repository as the way to add more documents to the document library.

How to add data to the solr's schema

I try to add new data to the solandra according to the solr's schema but I can't find any example about this. My ultimate goal is to integrate solandra with django-solr.
What I understand about the insert and updating in the solr based on the original solr and django-solr is to send the new data on the http protocol to the decent path, for example:
http://localhost:8983/solandra/wikipedia/update/json
However, when I access the url, the browser keep telling me HTTP ERROR: 404.
Can you help me understand the step to add new data and delete the data in the solandra environment?
I also have a look at the reuters-demo, but the procedure to insert data is process in the file of reutersimporter.jar, but I can't see the source as well. So Please help me to understand how the system work in terms of data inserting and deleting.
Thank you.
Since you are using the JSON update handler, this UpdateJSON page on the Solr Wiki has some good examples of inserting data using the JSON handler via curl. Also, the Indexing Data section of the Solr Tutorial shows how you can insert data using the post.jar file that is included with the Solr source.
Are you creating the solr schema.xml and solrconfig.xml and posting it to solandra? If you add the JSON handler then this should work. The reutersdemo uses solrj. django-solr should work as well.

Resources