title: Apache Jackrabbit JCA 2.7.5 .docx and .xlsx indexing
body: <p>I'm ussing the Appache Jackrabbit JCA 2.7.5, the problem is that files .docx and .xlsx is not indexed.</p>
  
  <p>My steps : </p>
  
  <ul>
  <li>Deploy the <a href="https://archive.apache.org/dist/jackrabbit/2.7.5/jackrabbit-jca-2.7.5.rar">Jackrabbit JCA</a> as <code>resource adapter</code> on glassfish</li>
  <li>create a <code>Connector Connection Pool</code> for the <code>resource adapter</code> indicating the <code>ConfigFile=path/to/the/repository.xml</code> and <code>HomeDir=path/to/the //miss the repository.xml</code></li>
  <li>create a <code>Connector Resources</code> for the connector pool (the jndi)</li>
  <li>create web application</li>
  <li><p>create class to get session from the connector ressources (code below)</p>
  
  <pre><code>import java.io.Serializable;
  import java.net.MalformedURLException;
  import javax.annotation.Resource;
  import javax.ejb.Stateless;
  import javax.jcr.LoginException;
  import javax.jcr.Repository;
  import javax.jcr.RepositoryException;
  import javax.jcr.Session;
  import javax.jcr.SimpleCredentials;
  import javax.naming.InitialContext;
  import javax.naming.NamingException;
  @Stateless
  public class OcmRepository implements Serializable {
  
      public Repository repository;
      public Session session;
  
      public OcmRepository() {
      }
  
      public Session getSession(String log, String mdp) throws LoginException, RepositoryException, NamingException, MalformedURLException {
          InitialContext initalContext = new InitialContext();
          repository = (Repository) initalContext.lookup("jndi/jca");
          session = repository.login(new SimpleCredentials(log, mdp.toCharArray()), null);
          return session;
      }
  }
  </code></pre></li>
  <li><p>Create custom filetype</p>
  
  <pre><code>import javax.jcr.PropertyType;
  import javax.jcr.Session;
  import javax.jcr.nodetype.NodeType;
  import javax.jcr.nodetype.NodeTypeManager;
  import javax.jcr.nodetype.NodeTypeTemplate;
  import javax.jcr.nodetype.PropertyDefinitionTemplate;
  
  /**
   *
   * @author nathan
   */
  public class FileType {
      public static void RegisterFileType(Session session) throws Exception {        
          NodeTypeManager nodeTypeManager = session.getWorkspace().getNodeTypeManager();
  
          NodeTypeTemplate nodeType = nodeTypeManager.createNodeTypeTemplate();
          nodeType.setName("FileType");
          String[] str = {"nt:resource"};        
          nodeType.setDeclaredSuperTypeNames(str);
          nodeType.setMixin(false);
          nodeType.setQueryable(true);
  
  
          PropertyDefinitionTemplate path = nodeTypeManager.createPropertyDefinitionTemplate();
          path.setName("jcr:path");
          path.setRequiredType(PropertyType.PATH);
          path.setQueryOrderable(false);
          path.setFullTextSearchable(false);
          nodeType.getPropertyDefinitionTemplates().add(path);
  
          PropertyDefinitionTemplate nom = nodeTypeManager.createPropertyDefinitionTemplate();
          nom.setName("jcr:nom");
          nom.setRequiredType(PropertyType.STRING);
          nom.setQueryOrderable(true);
          nom.setFullTextSearchable(true);
          nodeType.getPropertyDefinitionTemplates().add(nom);
  
          PropertyDefinitionTemplate description = nodeTypeManager.createPropertyDefinitionTemplate();
          description.setName("jcr:description");
          description.setRequiredType(PropertyType.STRING);
          description.setQueryOrderable(true);
          description.setFullTextSearchable(true);
          nodeType.getPropertyDefinitionTemplates().add(description);
  
          PropertyDefinitionTemplate motsCles = nodeTypeManager.createPropertyDefinitionTemplate();
          motsCles.setName("jcr:motsCles");
          motsCles.setRequiredType(PropertyType.STRING);
          motsCles.setQueryOrderable(true);
          motsCles.setFullTextSearchable(true);
          nodeType.getPropertyDefinitionTemplates().add(motsCles);
  
          PropertyDefinitionTemplate size = nodeTypeManager.createPropertyDefinitionTemplate();
          size.setName("jcr:size");
          size.setRequiredType(PropertyType.STRING);
          size.setQueryOrderable(true);
          size.setFullTextSearchable(false);
          nodeType.getPropertyDefinitionTemplates().add(size);
  
          PropertyDefinitionTemplate users = nodeTypeManager.createPropertyDefinitionTemplate();
          users.setName("jcr:users");
          users.setRequiredType(PropertyType.STRING);
          users.setQueryOrderable(true);
          users.setFullTextSearchable(false);
          nodeType.getPropertyDefinitionTemplates().add(users);
  
          PropertyDefinitionTemplate groupe = nodeTypeManager.createPropertyDefinitionTemplate();
          groupe.setName("jcr:groupe");
          groupe.setRequiredType(PropertyType.STRING);
          groupe.setQueryOrderable(true);
          groupe.setFullTextSearchable(false);
          nodeType.getPropertyDefinitionTemplates().add(groupe);
  
          NodeType newnodetype = nodeTypeManager.registerNodeType(nodeType, true);             
          session.save();        
      }
  
  }
  </code></pre></li>
  <li><p>Create the abstract class for persistence</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  import java.util.Map;
  
  import javax.jcr.Session;
  
  import org.apache.jackrabbit.ocm.query.Filter;
  import org.apache.jackrabbit.ocm.query.impl.FilterImpl;
  import org.apache.jackrabbit.ocm.query.impl.QueryImpl;
  import org.apache.jackrabbit.ocm.query.Query;
  import org.apache.jackrabbit.ocm.query.QueryManager;
  
  import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
  import org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl;
  
  import org.apache.jackrabbit.ocm.mapper.Mapper;
  import org.apache.jackrabbit.ocm.mapper.impl.annotation.AnnotationMapperImpl;
  
  import org.apache.jackrabbit.ocm.reflection.ReflectionUtils;
  
  
  /**
   *
   * @author nathan
   */
  public abstract class AbstractBean&lt;T&gt; {
  
      private Class&lt;T&gt; entityClass;
      private ObjectContentManager ocm;
      private Mapper mapper;
  
      public AbstractBean(Class&lt;T&gt; entityClass){
          this.entityClass = entityClass;
      }
  
      /**
       * Construct the Bean according to the extended class
       * This will be also construct the ObjectContentManager nammed ocm with the default Mapper
       * @param session javax.jcr.Session attached to the Bean
       * @return The mapping class found for the desired java bean class
       */
      public AbstractBean(Class&lt;T&gt; entityClass,Session session){
          this.entityClass = entityClass;
          ocm = new ObjectContentManagerImpl(session, this.getDefaultMapper());
      }
  
      /**
       * @return ObjectContentManager of the Bean
       */
      public ObjectContentManager getOcm() throws Exception{
          return ocm;
      }
  
      /**
       * Construct the Bean according to the extended class
       * This will be also construct the ObjectContentManager nammed ocm with the param Mapper given
       * @param session from "javax.jcr.Session" attached to the Bean
       * @param map from "org.apache.jackrabbit.ocm.mapper.Mapper" which 
       * is the use to map entity between apllication and The repository
       * @return ObjectContentManager of the Bean
       */   
      public ObjectContentManager getOcm(Session session, Mapper map) throws Exception{
          return new ObjectContentManagerImpl(session, map);
      }
  
      public void setOcm(ObjectContentManager ocm) {
          this.ocm = ocm;
      }
  
      private Mapper getDefaultMapper(){
          ReflectionUtils.setClassLoader(com.ged.ocm.entity.Groupe.class.getClassLoader());
          List&lt;Class&gt; classes = new ArrayList&lt;Class&gt;();
          classes.add(com.ged.ocm.entity.Fichier.class);
          classes.add(com.ged.ocm.entity.Dossier.class);
          classes.add(com.ged.ocm.entity.Groupe.class);
          classes.add(com.ged.ocm.entity.SimpleNode.class);
          return new AnnotationMapperImpl(classes);
      }
  
      public Mapper getMapper() {
          return mapper;
      }
  
      public void setMapper(Mapper mapper) {
          this.mapper = mapper;
      }
  
      public void setLoader(Class classe){        
          ReflectionUtils.setClassLoader(classe.getClassLoader());
      }
  
      public void create(T entity) {
          ocm.insert(entity);
          ocm.save();
      }
  
      public void edit(T entity) {
          ocm.update(entity);
          ocm.save();
      }
  
      public void remove(T entity) {
          ocm.remove(entity);
          ocm.save();
      }
  
      public void refresh(){
          ocm.refresh(true);
          ocm.save();
      }
  
      public void copy(String orgPath, String destPath){
          ocm.copy(orgPath, destPath);
          ocm.save();
      }
  
      public void move(String orgPath, String destPath){
          ocm.move(orgPath, destPath);
          ocm.save();
      }
      public void removeByPath(String path) {
          ocm.remove(path);
          ocm.save();
      }
  
      public void removeAllByEqual(Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          for (String key : filters.keySet())filter.addEqualTo(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          ocm.remove(query);
          ocm.save();
      }
  
      public void removeAllByEqual(String nodePath,Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope(nodePath);
          for (String key : filters.keySet())filter.addEqualTo(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          ocm.remove(query);
          ocm.save();
      }
  
      public boolean isPathExist(String path){
          return ocm.objectExists(path);
      }
  
      public T findByPath(String path) {
          try {            
              return (T)ocm.getObject(path);
          } catch (Exception e) {
              return null;
          }
      }
  
      public T findOneByEqual(Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          for (String key : filters.keySet())filter.addEqualTo(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
  
          T result = null;
          try {            
              result = results.get(0);
          } catch (Exception e) {
          }
  
          return result;
      }
  
      public List&lt;T&gt; findAllByEqual(Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope("//");
          for (String key : filters.keySet())filter.addEqualTo(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results;
      }
  
  
      public List&lt;T&gt; findAllByLike(Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope("//");
          for (String key : filters.keySet())filter.addLike(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results;
      }
  
      public List&lt;T&gt; findAllByLikeScoped(String scope,Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope(scope);
          for (String key : filters.keySet())filter.addLike(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results;
      }
  
      public List&lt;T&gt; findAllByOrLike(String attr,String[] val){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope("//");
          filter.addOrFilter(attr, val);
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results;
      }
  
      public T findOneByEqual(String nodePath, Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope(nodePath);
          for (String key : filters.keySet())filter.addEqualTo(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          T result = results.get(0);
          return result;
      }
  
      public List&lt;T&gt; findAllByEqual(String nodePath, Map&lt;String,String&gt; filters){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope(nodePath);
          for (String key : filters.keySet())filter.addEqualTo(key, filters.get(key));
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results;
      }
  
      public List&lt;T&gt; findAllByString(String query){        
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query,javax.jcr.query.Query.JCR_SQL2);
          return results;
      } 
  
  
      public List&lt;T&gt; findAllByParentPath(String nodePath){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope(nodePath);
  
          Query query = queryManager.createQuery(filter);
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results;
  
      }
      public List&lt;T&gt; findAllByParentPathOrder(String nodePath, String ordering){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope(nodePath);
  
          Query query = queryManager.createQuery(filter);
  //        query.addOrderByDescending(ordering);
          query.addOrderByAscending(ordering);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results;
  
      }
  
      public int coutChild(String nodePath){
          QueryManager queryManager = ocm.getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(entityClass);
          filter.setScope(nodePath);
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;T&gt; results = (List&lt;T&gt;) ocm.getObjects(query);
          return results.size();
      }
  
      public boolean ifExistByPath(String path){
          return ocm.objectExists(path);
      }
  
      public String getParentPath(String path){
          String parent="";
          String[] tmp=path.split("/");
          for (int i = 1; i &lt; (tmp.length-1); i++) {
              parent+="/"+tmp[i];
          }
          return parent;                
      }
  }
  </code></pre></li>
  <li><p>Create the bean</p>
  
  <pre><code>import javax.ejb.Stateless;
  import com.ged.ocm.entity.Fichier;
  import java.io.InputStream;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Map;
  import javax.jcr.Node;
  import javax.jcr.NodeIterator;
  import javax.jcr.Session;
  import javax.jcr.Workspace;
  import javax.jcr.query.QueryResult;
  import javax.jcr.query.qom.FullTextSearch;
  import javax.jcr.query.qom.StaticOperand;
  import org.apache.jackrabbit.ocm.query.Filter;
  import org.apache.jackrabbit.ocm.query.Query;
  import org.apache.jackrabbit.ocm.query.QueryManager;
  
  @Stateless
  public class FichierBean extends AbstractBean&lt;Fichier&gt;{    
      public FichierBean() {
          super(Fichier.class);
      }
      public FichierBean(Session session) {
          super(Fichier.class,session);
      }
  
      public List&lt;Fichier&gt; findAllByContains(String motCles) throws Exception {
          String requette = "SELECT * FROM FileType AS Res WHERE CONTAINS (Res.*, '*"+motCles+"*')";
          List&lt;Fichier&gt; results = (List&lt;Fichier&gt;) this.getOcm().getObjects(requette, javax.jcr.query.Query.JCR_SQL2);
          return results;                
      }
      public List&lt;Fichier&gt; findAllByContains(String path,String motCles) throws Exception {
          String requette = "SELECT * FROM FileType AS Res WHERE CONTAINS (Res.*, '*"+motCles+"*') ORDER BY Res.nom";
          List&lt;Fichier&gt; tmp = (List&lt;Fichier&gt;) this.getOcm().getObjects(requette, javax.jcr.query.Query.JCR_SQL2);
  
          List&lt;Fichier&gt; results = new ArrayList&lt;Fichier&gt;();
          for (Fichier fichier : tmp) {
              if(fichier.getPath().startsWith(path))results.add(fichier);
          }
          return results;                
      }
  
  
      public List&lt;Fichier&gt; fulltextByOCM(String motCles) throws Exception {
          QueryManager queryManager = this.getOcm().getQueryManager();
  
          Filter filter;
          filter = queryManager.createFilter(com.ged.ocm.entity.Fichier.class);
          filter.addContains(".", "*"+motCles+"*");
  
          Query query = queryManager.createQuery(filter);
  
          List&lt;Fichier&gt; results = (List&lt;Fichier&gt;) this.getOcm().getObjects(query);
          return results;
      }
  
  }
  </code></pre></li>
  </ul>
  
  <p>My configuration files :</p>
  
  <ul>
  <li><p>repository.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN"
                          "http://jackrabbit.apache.org/dtd/repository-1.6.dtd"&gt;
  &lt;Repository&gt;        
  &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
      &lt;param name="path" value="${rep.home}/repository"/&gt;
  &lt;/FileSystem&gt;
  --&gt;
  
  &lt;FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"&gt;
      &lt;param name="driver" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/&gt;
      &lt;param name="url" value="jdbc:mysql://:3306/db_ged_mysql" /&gt;
      &lt;param name="user" value="root" /&gt;
      &lt;param name="password" value="root" /&gt;
      &lt;param name="schema" value="mysql"/&gt;
      &lt;param name="schemaObjectPrefix" value="J_R_FS_"/&gt;
  &lt;/FileSystem&gt;
  
  &lt;!--
      security configuration
  --&gt;
  &lt;Security appName="Jackrabbit"&gt;
      &lt;AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager" /&gt;
      &lt;LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule"&gt;
          &lt;param name="anonymousId" value="anonymous" /&gt;
      &lt;/LoginModule&gt;
  &lt;/Security&gt;
  
  &lt;!--
      location of workspaces root directory and name of default workspace
  --&gt;
  &lt;Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/&gt;
  &lt;!--
      workspace configuration template:
      used to create the initial workspace if there's no workspace yet
  --&gt;
  &lt;Workspace name="${wsp.name}"&gt;
  
      &lt;PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager"&gt;
          &lt;param name="driver" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/&gt;
          &lt;param name="url" value="jdbc:mysql://:3306/db_ged_mysql" /&gt;
          &lt;param name="user" value="root" /&gt;
          &lt;param name="password" value="root" /&gt;
          &lt;param name="schema" value="mysql" /&gt;
          &lt;param name="schemaObjectPrefix" value="J_PM_${wsp.name}_" /&gt;
          &lt;param name="externalBLOBs" value="false" /&gt;
      &lt;/PersistenceManager&gt;
      &lt;FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"&gt;
          &lt;param name="driver" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/&gt;
          &lt;param name="url" value="jdbc:mysql://:3306/db_ged_mysql" /&gt;
          &lt;param name="user" value="root" /&gt;
          &lt;param name="password" value="root" /&gt;
          &lt;param name="schema" value="mysql"/&gt;
          &lt;param name="schemaObjectPrefix" value="J_FS_${wsp.name}_"/&gt;
      &lt;/FileSystem&gt;
  
      &lt;!--
          Search index and the file system it uses.
          class: FQN of class implementing the QueryHandler interface
      --&gt;
      &lt;SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"&gt;
          &lt;param name="path" value="${rep.home}/workspaces/${wsp.name}/index"/&gt;
          &lt;param name="tikaConfigPath" value="${rep.home}/tika-config.xml"/&gt;
          &lt;param name="useCompoundFile" value="true"/&gt;
          &lt;param name="minMergeDocs" value="100"/&gt;
          &lt;param name="volatileIdleTime" value="3"/&gt;
          &lt;param name="maxMergeDocs" value="2147483647"/&gt;
          &lt;param name="mergeFactor" value="10"/&gt;
          &lt;param name="maxFieldLength" value="10000"/&gt;
          &lt;param name="bufferSize" value="10"/&gt;
          &lt;param name="cacheSize" value="1000"/&gt;
          &lt;param name="forceConsistencyCheck" value="false"/&gt;
          &lt;param name="enableConsistencyCheck" value="false"/&gt;
          &lt;param name="autoRepair" value="true"/&gt;
          &lt;param name="analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/&gt;
          &lt;param name="queryClass" value="org.apache.jackrabbit.core.query.QueryImpl"/&gt;
          &lt;param name="respectDocumentOrder" value="true"/&gt;
          &lt;param name="resultFetchSize" value="2147483647"/&gt;
          &lt;param name="extractorPoolSize" value="0"/&gt;
          &lt;param name="extractorTimeout" value="100"/&gt;
          &lt;param name="extractorBackLogSize" value="100"/&gt;
          &lt;param name="supportHighlighting" value="true"/&gt;
          &lt;param name="excerptProviderClass" value="org.apache.jackrabbit.core.query.lucene.DefaultXMLExcerpt"/&gt;
      &lt;/SearchIndex&gt;
  &lt;/Workspace&gt;
  
  &lt;!--
      Configures the versioning
  --&gt;
  &lt;Versioning rootPath="${rep.home}/version"&gt;
      &lt;FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"&gt;
          &lt;param name="driver" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/&gt;
          &lt;param name="url" value="jdbc:mysql://:3306/db_ged_mysql" /&gt;
          &lt;param name="user" value="root" /&gt;
          &lt;param name="password" value="root" /&gt;
          &lt;param name="schema" value="mysql"/&gt;
          &lt;param name="schemaObjectPrefix" value="J_V_FS_"/&gt;
      &lt;/FileSystem&gt;
      &lt;PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager"&gt;
          &lt;param name="driver" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/&gt;
          &lt;param name="url" value="jdbc:mysql://:3306/db_ged_mysql" /&gt;
          &lt;param name="user" value="root" /&gt;
          &lt;param name="password" value="root" /&gt;
          &lt;param name="schema" value="mysql" /&gt;
          &lt;param name="schemaObjectPrefix" value="J_V_PM_" /&gt;
          &lt;param name="externalBLOBs" value="false" /&gt;
      &lt;/PersistenceManager&gt;
  &lt;/Versioning&gt;
  
  &lt;!--
      Search index for content that is shared repository wide
      (/jcr:system tree, contains mainly versions)
  
  &lt;SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"&gt;
      &lt;param name="path" value="${rep.home}/repository/index"/&gt;
      &lt;param name="extractorPoolSize" value="2"/&gt;
      &lt;param name="supportHighlighting" value="true"/&gt;
  &lt;/SearchIndex&gt;
  --&gt;
  
  &lt;!--
      Cluster configuration with system variables.
  
  --&gt;
  
  &lt;RepositoryLockMechanism class="org.apache.jackrabbit.core.util.CooperativeFileLock" /&gt;
  
  &lt;/Repository&gt;
  </code></pre></li>
  <li><p>tika-config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;properties&gt;
  
  &lt;mimeTypeRepository resource="/org/apache/tika/mime/tika-mimetypes.xml" magic="false"/&gt;
  
  &lt;parsers&gt;
  
  &lt;parser name="parse-dcxml" class="org.apache.tika.parser.xml.DcXMLParser"&gt;
    &lt;mime&gt;application/xml&lt;/mime&gt;
    &lt;mime&gt;image/svg+xml&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-office" class="org.apache.tika.parser.microsoft.OfficeParser"&gt;
    &lt;mime&gt;application/x-tika-msoffice&lt;/mime&gt;
    &lt;mime&gt;application/msword&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-excel&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-excel.sheet.binary.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-powerpoint&lt;/mime&gt;
    &lt;mime&gt;application/vnd.visio&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-outlook&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-ooxml" class="org.apache.tika.parser.microsoft.ooxml.OOXMLParser"&gt;
    &lt;mime&gt;application/x-tika-ooxml&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-package.core-properties+xml&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-officedocument.spreadsheetml.template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-excel.sheet.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-excel.template.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-excel.addin.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-officedocument.presentationml.presentation&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-officedocument.presentationml.template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-officedocument.presentationml.slideshow&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-powerpoint.presentation.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-powerpoint.slideshow.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-powerpoint.addin.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&lt;/mime&gt;
    &lt;mime&gt;application/vnd.openxmlformats-officedocument.wordprocessingml.template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-word.document.macroenabled.12&lt;/mime&gt;
    &lt;mime&gt;application/vnd.ms-word.template.macroenabled.12&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-html" class="org.apache.tika.parser.html.HtmlParser"&gt;
    &lt;mime&gt;text/html&lt;/mime&gt;
    &lt;mime&gt;application/xhtml+xml&lt;/mime&gt;
    &lt;mime&gt;application/x-asp&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser mame="parse-rtf" class="org.apache.tika.parser.rtf.RTFParser"&gt;
    &lt;mime&gt;application/rtf&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-pdf" class="org.apache.tika.parser.pdf.PDFParser"&gt;
    &lt;mime&gt;application/pdf&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-txt" class="org.apache.tika.parser.txt.TXTParser"&gt;
    &lt;mime&gt;text/plain&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-openoffice" class="org.apache.tika.parser.opendocument.OpenOfficeParser"&gt;
    &lt;mime&gt;application/vnd.sun.xml.writer&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.text&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.graphics&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.presentation&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.spreadsheet&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.chart&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.image&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.formula&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.text-master&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.text-web&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.text-template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.graphics-template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.presentation-template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.spreadsheet-template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.chart-template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.image-template&lt;/mime&gt;
    &lt;mime&gt;application/vnd.oasis.opendocument.formula-template&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.text&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.graphics&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.presentation&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.spreadsheet&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.chart&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.image&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.formula&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.text-master&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.text-web&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.text-template&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.graphics-template&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.presentation-template&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.spreadsheet-template&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.chart-template&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.image-template&lt;/mime&gt;
    &lt;mime&gt;application/x-vnd.oasis.opendocument.formula-template&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-image" class="org.apache.tika.parser.image.ImageParser"&gt;
    &lt;mime&gt;image/bmp&lt;/mime&gt;
    &lt;mime&gt;image/gif&lt;/mime&gt;
    &lt;mime&gt;image/jpeg&lt;/mime&gt;
    &lt;mime&gt;image/png&lt;/mime&gt;
    &lt;mime&gt;image/tiff&lt;/mime&gt;
    &lt;mime&gt;image/vnd.wap.wbmp&lt;/mime&gt;
    &lt;mime&gt;image/x-icon&lt;/mime&gt;
    &lt;mime&gt;image/x-psd&lt;/mime&gt;
    &lt;mime&gt;image/x-xcf&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-class" class="org.apache.tika.parser.asm.ClassParser"&gt;
    &lt;mime&gt;application/x-tika-java-class&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-mp3" class="org.apache.tika.parser.mp3.Mp3Parser"&gt;
    &lt;mime&gt;audio/mpeg&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-midi" class="org.apache.tika.parser.audio.MidiParser"&gt;
    &lt;mime&gt;application/x-midi&lt;/mime&gt;
    &lt;mime&gt;audio/midi&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;parser name="parse-audio" class="org.apache.tika.parser.audio.AudioParser"&gt;
    &lt;mime&gt;audio/basic&lt;/mime&gt;
    &lt;mime&gt;audio/x-wav&lt;/mime&gt;
    &lt;mime&gt;audio/x-aiff&lt;/mime&gt;
  &lt;/parser&gt;
  
  &lt;/parsers&gt;
  
  &lt;/properties&gt;
  </code></pre></li>
  </ul>
  
  <p>All query from the bean work except when I call the function <code>public List&lt;Fichier&gt; findAllByContains(String path,String motCles)</code> to fulltext search into .docx and .xslx document. Fulltext search on .pdf, .txt, .xml, .xls, .doc, ... work perfectly.</p>