cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Solr search does not return a correct result.

mohammed_amr
Champ in-the-making
Champ in-the-making
Dear Gurus,

I have an alfresco 4.0.b & 4.0.c and i have a problem shown in this releases and its not shown in the release 3.4.e.

Basically,

I have a dialog to create a node and another one for display the created in an arrangement matter, once i create a node and return back to the
display dialog the result is not accurate and there are a missed nodes.

After tracing, we ensure that the problem in the nodeService.query() where the returned nodes missed new nodes and that problem was not shown in the previous release such as 3.4.e.

Also, sometimes an exception has been thrown once nodeService.query() method invoked under request failed.


org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 11220099
        at org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:364)
        at org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:49)
        at org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:348)
        at org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:152)
        at org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:67)
        at org.alfresco.repo.search.AbstractSearcherComponent.query(AbstractSearcherComponent.java:53)
        at sun.reflect.GeneratedMethodAccessor396.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:65)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy13.query(Unknown Source)
        at com.tts.mersal.presentation.bean.dialog.util.NodeUtil.prepareOrganizationNodeById(NodeUtil.java:1468)
        at com.tts.mersal.presentation.bean.dialog.MersalOrganizationDialogBean$ProcessActionCallbakOperations$4.execute(MersalOrganizationDialogBean.
java:335)
        at com.tts.mersal.presentation.bean.dialog.MersalOrganizationDialogBean$ProcessActionCallbakOperations$4.execute(MersalOrganizationDialogBean.
java:1)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
        at com.tts.mersal.presentation.bean.dialog.MersalOrganizationDialogBean$2$1.doWork(MersalOrganizationDialogBean.java:436)
        at com.tts.mersal.presentation.bean.dialog.MersalOrganizationDialogBean$2$1.doWork(MersalOrganizationDialogBean.java:1)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:519)
        at com.tts.mersal.presentation.bean.dialog.MersalOrganizationDialogBean$2.execute(MersalOrganizationDialogBean.java:393)
        at com.tts.mersal.presentation.bean.dialog.MersalOrganizationDialogBean$2.execute(MersalOrganizationDialogBean.java:1)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
        at com.tts.mersal.presentation.bean.dialog.MersalOrganizationDialogBean.processAction(MersalOrganizationDialogBean.java:471)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
        at javax.faces.component.UICommand.broadcast(UICommand.java:131)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:115)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:191)
        at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:105)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:80)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:143)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:104)
        at sun.reflect.GeneratedMethodAccessor419.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy223.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)
        at sun.reflect.GeneratedMethodAccessor419.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy223.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1584)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketException: Software caused connection abort: recv failed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
        at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:755)
        at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
        at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
        at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
        at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:141
3)
        at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
        at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:318)
        … 73 more

for your notice, NodeUtil.java:1468 represent the query invocation.

Can you please tell me where is the problem and how can i solve it, or if there is a way to upgrade the solr search engine to fix the problems.


Thanks
Mohammed Amr
Senior System Developer.
Digital Series Co.
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
You shouldn't be using SOLR for that type of transactional request.

mohammed_amr
Champ in-the-making
Champ in-the-making
I don't use a solr, i'm using the lucene search and that search was return a correct result.

Simply you can notice my code


   /**
    * @CATEGORY STATIC METHOD
    * @RETRUN LIST OF POSITIONS
    * @DESCRIPTION THIS METHIOD AIMED TO RETREIVE ALL POSITIONS IN THE
    *              POSITIONS FOLDER EITHER TEMPORAL OR NOT.
    *
    * */
   public static List<Node> prepareNodeList(String nodeType,boolean isTemporal) {
      // CREATE A NEW LIST OF NODES TYPES
      List<Node> nodes = new ArrayList<Node>();
      // CREATE A RESULT SET
      ResultSet rs = null;
      try {
         // PREPARE THE SEARCH PARAMETERES
         SearchParameters searchParameters = new SearchParameters();
         searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);
         searchParameters.setNamespace(Constants.DIGITAL_SERIES_SECURITY_MODEL_NAMESPACE_STRING);
         searchParameters
               .setQuery("TYPE:\""
                     + Constants.DIGITAL_SERIES_SECURITY_MODEL_NAMEPSACE_PREFIX_STRING
                     + ":" + nodeType + "\"");
         searchParameters.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
         // MAKE A QUERY TO FETCH ALL NODES OF PASSED TYPE
         rs = NodeUtil.searchService.query(searchParameters);
         // ITERATE OVER RESULT SET
         Iterator<ResultSetRow> it = rs.iterator();
         LOG.debug("NODE LIST SIZE IS: "+rs.getNodeRefs().size());
         if (rs != null && rs.getNodeRefs().size() > 0) {
            while (it.hasNext()) {
               // FETCH THE ROW
               ResultSetRow row = it.next();
               // FETCH THE NODE REF FROM THE ROW
               NodeRef nodeRef = row.getNodeRef();
               if(NodeUtil.nodeService.exists(nodeRef)){
                  Node temporalNode = new Node(nodeRef);
                  if(temporalNode.getProperties().get(determineIdPropertyQName(nodeType)) != null && !isTemporal){
                     nodes.add(temporalNode);
                  }
                  else if(temporalNode.getProperties().get(determineIdPropertyQName(nodeType)) == null && isTemporal) {
                     nodes.add(temporalNode);
                  }
               }
            }
         }
      } catch (Exception e) {
         // ADD EXCEPTION ON THE SCREEN
         Utils.addErrorMessage(Application.getMessage(FacesContext
               .getCurrentInstance(), PREPARE_NODE_LIST_ERROR_MSG), e);
         // ROLLBACK THE TRANSACTION
         ReportedException.throwIfNecessary(e);
      } finally {
         rs.close();
      }
      return nodes;
   }

I'm not use a solr, but by default alfresco 4.0.b use it, is there a way to turn it off ?

Thanks

mrogers
Star Contributor
Star Contributor
index.subsystem.name=lucene