. Advanced Search improvements

. Fix to Lucene Indexer (from Andy) to correct the bug where if content was not indexed (e.g. JPEG) then it's mimetype/size values did not get added to the index.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2107 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast 2006-01-13 13:21:29 +00:00
parent 4e3f42d47a
commit 6c65b84a91

View File

@ -1395,6 +1395,9 @@ public class LuceneIndexerImpl extends LuceneBase implements LuceneIndexer
ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value);
if (index)
{
// store mimetype in index - even if content does not index it is useful
doc.add(new Field(attributeName+".mimetype", contentData.getMimetype(), false, true, false));
ContentReader reader = contentService.getReader(nodeRef, propertyName);
if (reader != null && reader.exists())
{
@ -1459,7 +1462,6 @@ public class LuceneIndexerImpl extends LuceneBase implements LuceneIndexer
}
doc.add(Field.Text("TEXT", isr));
ris = reader.getReader().getContentInputStream();
try
{
@ -1473,9 +1475,6 @@ public class LuceneIndexerImpl extends LuceneBase implements LuceneIndexer
doc.add(Field.Text("@"
+ QName.createQName(propertyName.getNamespaceURI(), ISO9075
.encode(propertyName.getLocalName())), isr));
doc.add(new Field(attributeName+".mimetype", contentData.getMimetype(), false, true, false));
}
}