0
对于Google Drive使用JavaScript v2 API,我陷入了一种情况,新创建的文件似乎被很好地搜索索引,但是对同一个ID没有进一步的文件更新实际上改变了meta-数据。 (所以在保存文件后,即使删除了旧内容,我仍然可以找到它,但没有新内容似乎返回搜索结果)。任何人都可以用正确的方向帮助指针吗?在元数据中设置indexableText以及在params中使用useContentAsIndexableText时会发生这种情况。这里是我们使用的代码片段:indexableText没有通过Google Drive SDK进行更新
boundary = '-------314159265358979323846',
delimiter = '\r\n--' + boundary + '\r\n',
closeDelim = '\r\n--' + boundary + '--',
data = JSON.stringify(mapInfo.idea),
metadata = {
'title': mapInfo.idea.title + '.mup',
'mimeType': contentType,
'indexableText': {'text': contentSummary }
},
multipartRequestBody =
delimiter +
'Content-Type: application/json\r\n\r\n' +
JSON.stringify(metadata) +
delimiter +
'Content-Type: ' + contentType + '\r\n' +
'\r\n' +
data +
closeDelim,
request = gapi.client.request({
'path': '/upload/drive/v2/files' + (googleId ? '/' + googleId : ''),
'method': (googleId ? 'PUT' : 'POST'),
'params': {'uploadType': 'multipart', 'fileId': googleId },
'headers': {
'Content-Type': 'multipart/mixed; boundary=\'' + boundary + '\''
},
'body': multipartRequestBody
});
在此先感谢您的任何帮助。