cancel
Showing results for 
Search instead for 
Did you mean: 

Problem Indexing d:content properties

oskarlanda
Champ in-the-making
Champ in-the-making
Hello,

Alfresco Community 4.0.e (using Solr) is not indexing content type properties when updating content.

After content update, I try to search the node using the lucene query TEXT:"inmenso" (that is in the text of this property) but the result is 0 nodes. After a full reindex the same result.

My aspect definition is:


   <aspect name="btz:ocr">
      <title>OCR</title>
      <properties>
          <property name="btz:ocrContent">
         <title>Texto del OCR</title>
             <type>d:content</type>
                        <index enabled="true">
                           <atomic>true</atomic>
                           <stored>false</stored>
                           <tokenised>true</tokenised>
                        </index>
          </property>
      </properties>
   </aspect>   


My function for the update process is:


   public void setContentValue(NodeRef nodeRef, QName propertyQName, Object hmcontent) throws Exception {

      UserTransaction trx = transactionService.getUserTransaction();

      try {
         trx.begin();

                        nodeService.addAspect(nodeRef, btz:ocr, null);

         ContentWriter contentWriter = contentService.getWriter(nodeRef, propertyQName, true);
         contentWriter.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN);
         contentWriter.putContent(hmcontent.toString());
         contentWriter.guessEncoding(); //setEncoding("UTF-8");

         trx.commit();

      } catch (Exception e) {
         trx.rollback();
         throw e;
      }
   }


Any ideas ?

5 REPLIES 5

kaynezhang
World-Class Innovator
World-Class Innovator
Please check if you have ever added "cm:indexControl" aspect to your node.cm:indexControl aspect  can disable full text indexing of content.

mrogers
Star Contributor
Star Contributor
One possible explanation/guess : while the repository does support multiple instances of type d:content on a node, quite a lot of alfresco doesn't and assumes that there will only be cm:content.   For example I don't know whether the transformation subsystem will cope with multiple transformations (1 for each content property)  

It is possible that indexing only indexes the cm:content property.

oskarlanda
Champ in-the-making
Champ in-the-making
Those are node aspects:

{http://www.alfresco.org/model/content/1.0}auditable
{http://www.alfresco.org/model/system/1.0}referenceable
{http://www.alfresco.org/model/content/1.0}titled
{http://www.alfresco.org/model/rendition/1.0}renditioned
{http://www.alfresco.org/model/system/1.0}localized
{http://www.baratz.es/model/baratz/1.0}ocr
{http://www.alfresco.org/model/content/1.0}versionable



More information:

The type of the node is cm:content and the cm:content property mimetype is image/tiff



My original content are image/tiff documents, so I'm using an external OCR for extract the image content and writing this content in another property to make the file content searchable.

Any ideas about who can I do this in another way (without two different d:content properties) ?

Thanks


oskarlanda
Champ in-the-making
Champ in-the-making
So, if only default cm:content property is indexing when more than one d:content type properties have value for one node… is a bug of Alfresco ?