cancel
Showing results for 
Search instead for 
Did you mean: 

DB Query using fts-alfresco and PATH?

sarah_jordison
Champ in-the-making
Champ in-the-making
Hi Guys,

Does anyone know if it's possible to run a query inside a folder using fts-alfresco…and have it not wait for SOLR? Even if I create files, it takes a few minutes to pick it up and my end-users think something broke. I would like to have the query run at the transaction level and display simple things, like new documents.

In earlier version of Alfresco this would just work. I really don't want to have to create another folder for my completed documents and then use childByNamePath, because I hear that causes performance issues (plus its a sucky solution).

Here is my code:


   …
   getAll : function(department)
   {
      var query, def;
      
                //Look within a folder and search for specific documents with aspect completed
      query = 'PATH:"//app:company_home/app:dictionary/cm:SomeCo/'+department+'/*" AND TYPE:"cm:content" AND ASPECT:"someco:completed"';
      
      //Define Query params
           def =
      {
         query: query,
         store: "workspace://SpacesStore",
         language: "fts-alfresco",
         sort: [{  column: "@{http://www.alfresco.org/model/content/1.0}name",  ascending: true } ]
      };

      //Resultset!
      return search.query(def);
   }



And I have also added this to alfresco-global.properties


solr.query.cmis.queryConsistency=TRANSACTIONAL_IF_POSSIBLE
solr.query.fts.queryConsistency=TRANSACTIONAL_IF_POSSIBLE

### Optional patch that adds required indexes to the DB ###
system.metadata-query-indexes.ignored=false
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

you can't search for PATH using DB FTS. If you only want to look for children of a specific folder, you can use PARENT:"some://node/ref" as a query condition. You'd have to resolve the path to the node first but other than that, it is ideal for the use case you described.

Regards
Axel