Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-42239

Solr3 & Solr4: Search for users and blog tags returns Current URL java.lang.NullPointerException



      Steps to reproduce:

      1. Download apache-solr-3.5.0.zip from 'http://archive.apache.org/dist/lucene/solr/3.5.0/'
      2. Unzip apache-solr-3.5.0.zip anywhere
      3. Navigate to apache-solr-3.5.0/example in terminal and type 'java -jar start.jar'
      4. After the server has started up, shut it down
      5. Start Liferay and deploy the Solr3 plugin
      6. After it's started, shut it down
      7. Navigate in folder to /tomcat-7.0.42/webapps/solr3-web/WEB-INF/classes/META-INF
      8. Open solr-spring.xml
      9. Change 'http://localhost:8080/solr' to 'http://localhost:8983/solr'
      10. The changed line should look like this: <constructor-arg type="java.lang.String" value="http://localhost:8983/solr/" />
      11. Save and close solr-spring.xml
      12. Navigate in folder to /tomcat-7.0.42/webapps/solr3-web/WEB-INF/conf
      13. Copy the schema.xml file
      14. Paste the file in apache-solr-3.5.0/example/solr/conf to replace the existing schema.xml file
      15. Start the Solr3 server in apache-solr-3.5.0/example (java -jar start.jar)
      16. Start liferay
      17. There will be a lot of outut on the Solr3 console (means it's working)
      18. Navigate to Control Panel > Server Administration and reindex the search indexes
      19. Navigate to Control Panel > Users > Users and Organisations
      20. Add a user (test1)
      21. Go back to Liferay and add these portlets: Search, Blogs, Portal Directory
      22. Add a blogs post with something unique
      23. Click Categorization and add tags
      24. After adding the blog post, search for it in the Search portlet
      25. Assert that the search returns your blog and the tags appear
      26. Go back and search for one of the blog tags
      27. Search for the created user (test1)
      28. Go to 'http://localhost:8983/solr/admin/schema.jsp'
      29. In the left sidebar, go to Fields > TITLE
      30. Assert that the words in your blog title show up in 'Top Terms'
      31. Navigate to Fields > SCREENNAME
      32. Change the number of Top Terms to the number shown next to 'Distinct:' which is above Top Terms
      33. Assert that the created user (test1) is on the list
      34. Navigate to Fields > ASSETTAGNAMES
      35. Assert that your blog tags appear on Top Terms

      Expected result:
      The search for the created user and blog tags should return a result and no console errors should be seen in the liferay terminal.

      Actual result:
      Nothing is returned for the searches and the liferay terminal returns errors:

      19:38:18,604 ERROR [http-bio-8080-exec-4][IncludeTag:129] Current URL /web/guest/home?p_p_id=3&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=2&_3_struts_action=%2Fsearch%2Fsearch&_3_redirect=%2Fweb%2Fguest%2Fhome&_3_keywords=test1&_3_groupId=0 generates exception: com.liferay.portal.kernel.search.SearchException: java.lang.NullPointerException
              at com.liferay.portal.kernel.search.HitsImpl.setScores(HitsImpl.java:164)
              at com.liferay.portal.kernel.search.BaseIndexer.filterSearch(BaseIndexer.java:1397)
              at com.liferay.portal.kernel.search.FacetedSearcher.search(FacetedSearcher.java:99)
              at org.apache.jsp.html.portlet.search.search_jsp._jspService(search_jsp.java:1086)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
              at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
              at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
              at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
              at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
              at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3807)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)


      1. No errors should be seen at all in the Solr3 or Solr4 terminals.
      2. In order to test this for Solr4, follow the steps in the related ticket, LPS-42242 in order to start up Liferay with the Solr4 server.
      3. To assert that the Solr4 server is indexing information, go to these links and press the Load Term Info button:
        http://localhost:8983/solr/#/collection1/schema-browser?field=assetTagNames (Blog tags)
        http://localhost:8983/solr/#/collection1/schema-browser?field=title (Blog Entry title)
        http://localhost:8983/solr/#/collection1/schema-browser?field=screenName (created User)


        1. Solr3-BlogTags.png
          26 kB
        2. Solr3-User.png
          21 kB
        3. Solr4-BlogEntry.png
          39 kB
        4. Solr4-BlogTags.png
          42 kB
        5. Solr4-User.png
          40 kB
        6. Solr-BlogEntryResult.png
          24 kB
        7. Solr-BlogTagsResult.png
          4 kB
        8. Solr-UserResult.png
          4 kB

          Issue Links



              jane.kim Jane Kim (Inactive)
              jane.kim Jane Kim (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
              0 Vote for this issue
              1 Start watching this issue


                Days since last comment:
                7 years, 2 weeks, 5 days ago


                  Version Package
                  6.2.10 EE GA1