简体   繁体   English

indexableText无法使用Google Drive SDK更新

[英]indexableText not updating with Google Drive SDK

Using the JavaScript v2 API for Google Drive, I got into a situation where newly created files seem to be nicely indexed for search, but no further file updates to the same ID actually change the meta-data. 使用适用于Google云端硬盘的JavaScript v2 API,我遇到了这样一种情况,即新创建的文件似乎可以很好地索引以进行搜索,但是没有对相同ID的进一步文件更新实际上会更改元数据。 (so after a file is saved, I can still find it using the old content even when deleted, but no new content seems to return search results). (因此,保存文件后,即使删除了文件,我仍然可以使用旧内容找到它,但是似乎没有新内容返回搜索结果)。 Can anyone help with a pointer in the right direction? 任何人都可以向正确的方向提供帮助吗? This happens when setting indexableText in metadata as well as useContentAsIndexableText in params. 在元数据中设置indexableText以及在params中设置useContentAsIndexableText时,会发生这种情况。 Here's a code snippet that we use: 这是我们使用的代码片段:

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
});

Thanks in advance for any help with this. 在此先感谢您的任何帮助。

I believe that the two are mutually exclusive. 我相信两者是互斥的。 useContentAsIndexableText means that the content is indexable. useContentAsIndexableText表示内容是可索引的。 indexableText is something you pass if your content is binary. 如果内容为二进制,则indexableText是您传递的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM