2013-03-21 34 views
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 
}); 

在此先感謝您的任何幫助。

回答

0

我相信這兩者是相互排斥的。 useContentAsIndexableText意味着內容是可索引的。如果您的內容是二進制文件,indexableText就是您傳遞的內容。