/** * Serializes the given extraction result and saves it in the disk cache.<p> * * @param rfsName the RFS name of the file to save the extraction result in * @param content the extraction result to serialize and save * * @throws IOException in case of disk access errors */ public void saveCacheObject(String rfsName, I_CmsExtractionResult content) throws IOException { byte[] byteContent = content.getBytes(); if (byteContent != null) { CmsVfsDiskCache.saveFile(rfsName, byteContent); } } }
/** * Serializes the given extraction result and saves it in the disk cache.<p> * * @param rfsName the RFS name of the file to save the extraction result in * @param content the extraction result to serialize and save * * @throws IOException in case of disk access errors */ public void saveCacheObject(String rfsName, I_CmsExtractionResult content) throws IOException { byte[] byteContent = content.getBytes(); if (byteContent != null) { CmsVfsDiskCache.saveFile(rfsName, byteContent); } } }
/** * Extends the given document by a field that contains the extracted content blob.<p> * * @param document the document to extend * @param cms the OpenCms context used for building the search index * @param resource the resource that is indexed * @param extractionResult the plain text extraction result from the resource * @param properties the list of all properties directly attached to the resource (not searched) * @param propertiesSearched the list of all searched properties of the resource * * @return the document extended by a field that contains the extracted content blob */ protected I_CmsSearchDocument appendContentBlob( I_CmsSearchDocument document, CmsObject cms, CmsResource resource, I_CmsExtractionResult extractionResult, List<CmsProperty> properties, List<CmsProperty> propertiesSearched) { if (extractionResult != null) { byte[] data = extractionResult.getBytes(); if (data != null) { document.addContentField(data); } } return document; }
byte[] data = content.getBytes(); if (data != null) { Fieldable field = new Field(CmsSearchField.FIELD_CONTENT_BLOB, data, Field.Store.COMPRESS);