Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 6.0.0 Preview
-
Fix Version/s: 6.0.0 Preview
-
Component/s: Tools, Tools > Plugins SDK
-
Labels:None
-
Branch Version/s:5.1.x, 5.2.x
-
Liferay Contributor's Agreement:Accept
-
Similar Issues:
Description
I have taken latest version of Portal and solr-web plugins from 5.2.x branches.
I have Solr 1.3.
Performed all the required steps to make solr work based on information available at various sources in community.
Everything was setup fine and I can do seach in solr admin interface for liferay content.
I can also do search in Control Panel.
Issue was coming in Search Portlet. Anything I search was resulting in NPE like from all OpenSearchImpl. Only directory search was resulting the content.
So search portlet is not working when configured with solr.

I have done debugging to find out root cause of this issue and found that NPE is being thrown from class.
portal-kernel/src/com/liferay/portal/kernel/search/HitsImpl.java
In that class there is method
public String snippet(int n)
{ return _snippets[n]; }But in my case _snippet is Null , so it throws NPE. I have small content in each of my blog , wiki and web content i.e "Test this feature" , I not sure why snippet is coming as null.
So I have modified above function like
public String snippet(int n) {
{ return null; }if(_snippets == null)
return _snippets[n];
}
After doing this change and redeploying portal NPE Gone and it worked like charm.