我想查询使用SearchService Alfresco的一些文件; 我的想法是:
1) 获取文件夹的noderef,我想在搜索文件
2)然后得到通过NodeService noderef的路径
3)最后通过SearchService查询太阳能找到特定的路径文件
这个问题引起了查询到Solr的时候,我得到以下异常:
ERROR [solr.core.SolrCore] [http-bio-8443-exec-1] org.apache.solr.common.SolrException: org.apache.lucene.queryParser.ParseException: **Cannot parse** 'PATH:"/{http\://www.alfresco.org/model/application/1.0}company_home/{http\://www.alfresco.org/model/application/1.0}user_homes/{http\://www.alfresco.org/model/content/1.0}abeecher/{http\://www.alfresco.org/model/content/1.0}nominas//*"': **Failed to parse XPath**...
Unexpected '{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/application/1.0}user_homes/{http://www.alfresco.org/model/content/1.0}abeecher/{http://www.alfresco.org/model/content/1.0}nominas//*'
如果我按类型厘米的前缀更换全前缀:等...查询效果很好。
是否有任何“露天路”要做到这一点,而不是转化用正则表达式的字符串? 还是我做错了什么?
我使用的代码是:
Path path3 = nodeService.getPath(folder);
SearchParameters sp = new SearchParameters();
sp.addStore(Repository.getStoreRef());
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.setQuery("PATH:\"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/application/1.0}user_homes/{http://www.alfresco.org/model/content/1.0}abeecher/{http://www.alfresco.org/model/content/1.0}nominas//*\"");
//sp.setQuery(path3);
//sp.setQuery(path3.toString());
ResultSet results = null;
results = searchService.query(sp);