code: public List<Descriptor> searchArtifacts(SessionProvider sp, SearchCriteria criteria) throws RepositoryException
     {
        Session session = currentSession(sp);
  
        session.refresh(true);
        session.save();
  
        String param = criteria.getContainsExpr();
        String pathConstraint = "";
        if (rootNodePath.length() > 1)
        { // artifact root is some real node
           if (rootNodePath.endsWith("/"))
              pathConstraint = rootNodePath + "%/" + param + "[%]";
           else
              pathConstraint = rootNodePath + "/%/" + param + "[%]";
        }
        else
        {
           pathConstraint = "/%/" + param + "[%]"; // artifact root is workspace root
        }
        // node !!
  
        String sqlQuery = String.format("SELECT * FROM nt:folder WHERE jcr:path LIKE '%s' ", pathConstraint);
  
        LOG.info(sqlQuery);
        QueryManager manager = session.getWorkspace().getQueryManager();
        Query query = manager.createQuery(sqlQuery, Query.SQL);
  
        QueryResult queryResult = query.execute();
        NodeIterator iterator = queryResult.getNodes();
  
        List<Descriptor> preciseNode = new ArrayList<Descriptor>();
        while (iterator.hasNext())
        {
  
           Node candidate = iterator.nextNode();
  
           Descriptor descriptor = new FolderDescriptor(candidate.getPath());
           preciseNode.add(descriptor);
  
        }
  
        return preciseNode;
     }
docs: /*
  (non-Javadoc)
  @see org.exoplatform.services.jcr.ext.maven.ArtifactManagingService#searchArtifacts
  (org.exoplatform.services.jcr.ext.common.SessionProvider,
  org.exoplatform.services.jcr.ext.maven.SearchCriteria)