cancel
Showing results for 
Search instead for 
Did you mean: 

Indexed attributes

spl
Champ in-the-making
Champ in-the-making
Hi.

In addition to having indexed attributes in my custom model, i would like to make "cm:content"'s name, title and other attibutes indexed.

Please,
How do you declare these "native" attibutes (title, name) to be indexed ?
And on the other hand, how do you schedule a "rebuildIndex" or how do you rebuild the indexes ?

Thanks.
9 REPLIES 9

steve
Champ in-the-making
Champ in-the-making

spl
Champ in-the-making
Champ in-the-making
Read it, but my concerns are not web client advanced search customization.

My 2 questions about content management are :

* how to you tell alfresco to index cm:content ' s attributes ?
* how do you tell / schedule alfresco / lucene to rebuild indexes ?

(Things that documentum call job / method like FT_INDEX / RESET_FT_INDEX …………., i ve been a DCTM dev/administrator for 4 years now).

Thanks.

kevinr
Star Contributor
Star Contributor
All meta-data attributes and cm:content full-text are indexed atomically by default. The Data Dictionary Guide explains how to create properties for custom types etc. that are indexed, such as:

      <property name="cm:example">
          <type>d:text</type>
          <mandatory>false</mandatory>
          <index enabled="true">
             <atomic>false</atomic>       <!– index in the background –>
             <stored>false</stored>       <!– store the property value in the index –>
             <tokenised>true</tokenised>
          </index>
      </property>
In Alfresco all content and meta-data is indexed automatically and atomically - so it available immediately - unless you configure properties otherwise (i.e. for background indexing if you prefer). Therefore you do not need to rebuild the indexes with a job unless there is disk corruption or similar. Rebuilding the indexes is easy though, just uncomment the second line here:
# The index recovery mode (NONE, VALIDATE, AUTO, FULL)
#index.recovery.mode=FULL
in the file:
\tomcat\shared\classes\alfresco\extension\custom-db-connection.properties

Hope this helps,

Kevin

spl
Champ in-the-making
Champ in-the-making
Thanks for these clear answers.

Just please tell me if i'm wrong :
if i uncomment the "index.recovery.mode=FULL", then, indexes are rebuilt at repository startup ?

kevinr
Star Contributor
Star Contributor
That is correct.

Thanks,

Kevin

spl
Champ in-the-making
Champ in-the-making
Thanks again.

spl
Champ in-the-making
Champ in-the-making
By the way, (thanks to your help, i dig), is there any known drawback to use the code below to rebuild all indexes ? :


   FullIndexRecoveryComponent indexRecoverer = (FullIndexRecoveryComponent) act.getBean("indexRecoveryComponent");

   try {
        indexRecoverer.setRecoveryMode(FullIndexRecoveryComponent.RecoveryMode.FULL.name());
        indexRecoverer.reindex();
   } catch (Exception e) {
      e.printStackTrace();
   }

andy
Champ on-the-rise
Champ on-the-rise
Hi

I think that is OK. I have not checked to see if you can do two rebuilds at the same time and get into trouble. You can check if a rebuild is already in progress. Normally there would be no need to do such a rebuild.

In the not too distant future the rebuild will move into the bootstrap sequence
and will require a repo instance level lock.

What are you trying to do? Why is this an issue?

Cheers

Andy

spl
Champ in-the-making
Champ in-the-making
Hi Andy

My concerns in few points :

- repository as a server
- custom web/client
- custom models
- basic custom API (but i need to dig into templates)
- batch import
- batch delete
….

And particularly :
- my models are evolving, also, as i wish to import / remove content in batch mode i need to care about index update too …..

Thank you for reading.