cancel
Showing results for 
Search instead for 
Did you mean: 

Searching content and metadata of nodes using Search Service in Alfresco 5

kumar_mullur_08
Champ in-the-making
Champ in-the-making
Hello ,

I have just upgraded to alfresco 5 from 4.2. All the web services which were developed for alfresco 4.2 are working fine except the search web service. In search web service, searchService is used with alfresco fts search language. In the query, I have used "ALL" to search both node's content and metadata but in 5 it is throwing exception. Here's the query and exception.

Query:
( ALL:can) AND ( TYPE: "someco:whitepaper"  ) AND ( PATH:"/app:company_home/cm:someco//*")

Exception:
2015-06-01 14:40:02,663 ERROR [org.apache.solr.servlet.SolrDispatchFilter] null:java.lang.UnsupportedOperationException
   at org.alfresco.solr.query.Solr4QueryParser.createAllQuery(Solr4QueryParser.java:1005)
   at org.alfresco.solr.query.Solr4QueryParser.getFieldQuery(Solr4QueryParser.java:615)
   at org.alfresco.solr.query.Lucene4QueryParserAdaptor.getFieldQuery(Lucene4QueryParserAdaptor.java:67)
   at org.alfresco.solr.query.Lucene4QueryParserAdaptor.getFieldQuery(Lucene4QueryParserAdaptor.java:48)
   at org.alfresco.repo.search.impl.querymodel.impl.lucene.functions.LuceneFTSTerm.addComponent(LuceneFTSTerm.java:68)
   at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneFunctionalConstraint.addComponent(LuceneFunctionalConstraint.java:57)
   at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneConjunction.addComponent(LuceneConjunction.java:65)
   at org.alfresco.repo.search.impl.querymodel.impl.lucene.LuceneQuery.buildQuery(LuceneQuery.java:105)
   at org.alfresco.solr.AlfrescoSolrDataModel.getFTSQuery(AlfrescoSolrDataModel.java:2099)
   at org.alfresco.solr.query.AlfrescoFTSQParserPlugin$AlfrescoFTSQParser.parse(AlfrescoFTSQParserPlugin.java:80)
   at org.apache.solr.search.QParser.getQuery(QParser.java:141)
   at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:148)
   at org.apache.solr.handler.component.AlfrescoSearchHandler.handleRequestBody(AlfrescoSearchHandler.java:233)
   at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
   at org.apache.solr.core.SolrCore.execute(SolrCore.java:1962)
   at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)
   at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)
   at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:613)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   at java.lang.Thread.run(Thread.java:745)


How to search node's content and meatadata in alfresco 5 through Search Service?



Thanks,
Kumar Mullur
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
I note that ALL is not listed on the official docs http://docs.alfresco.com/5.0/concepts/rm-searchsyntax-fields.html while it is on the public wiki.

Its therefore either a bug (oversight) or there's a good reason for this not being included in 5.0.

Hi Rogers, Thanks for your quick reply,

Is there a way to search node's content as well as it's metadata?

Im trying to write a search web service in java which will take a term as arguement and i want to search that term in document as well as meata data of that node using SearchService. Is this possible in alfresco 5?.

Please let me know how can i acheive this.


Thanks and regards,
Kumar Mullur  

kumar_mullur_08
Champ in-the-making
Champ in-the-making
Hi,

Still could not find solution for the above problem. As a work around, now i am reatrieving all properties from content type and appending it to query. Is there a better way to solve this problem?. The sample query is given below.

( ( TEXT:can) OR ( sc:campaign:can OR scSmiley Tongueroduct:can ) ) AND ( TYPE: "sc:whitepaper" ) AND ( PATH:"/app:company_home/cm:someco//*")

Is there any better solution to achieve this?. Please let me know.

Thanks
Kumar Mullur

kumar_mullur_08
Champ in-the-making
Champ in-the-making
The ALL keyword is working fine in alfresco community 5.1 stable release(Feb 2016).