AnsweredAssumed Answered

DB Query using fts-alfresco and PATH?

Question asked by sarah.jordison on Feb 20, 2016
Latest reply on Feb 22, 2016 by afaust
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

Outcomes