Help! I'm getting so frustrated with Liferay right now that I am contemplating switching over to the red side (Oracle).
Summary.
1. I query SOLR using the solrj library (works).
2. The result (SolrDocumentList) is added to the renderRequest as an attribute to get it back to the JSP (works).
1
2renderRequest.setAttribute("searchResults", resultsList);
3. In the JSP I retrieve the list (works).
1
2 int recordCount = 0;
3 SolrDocumentList searchResults = (SolrDocumentList)renderRequest.getAttribute("searchResults");
4
5 if ( searchResults != null )
6 recordCount = searchResults.size();
4. I bind the variable used to store this (searchResults) to the search-container-results (like so)
1
2<liferay-ui:search-container-results results="<%= searchResults %>" total="<%= recordCount %>" >
5. My schema in SOLR has three fields I am concerned with --
name (type="text_general" multiValue="false")
parents (type="text_general" multiValue="true")
children (type="text_general" multiValue="true")
Outputting the name column like so (works).
1
2<liferay-ui:search-container-column-text
3 name="skill"
4 value='<%= solrDocument.getFieldValue("name").toString() %>'
5 />
6. When I try eiher the children or the parents, I get a stack trace --
1
2<liferay-ui:search-container-column-text
3 name="skill"
4 value='<%= solrDocument.getFieldValue("parents").toString() %>'
5 />
.. the stack trace ultimately giving a null pointer exception. I checked the portal source and the columns want Strings... and the toString() generates one. The only difference really is that for the name its a single value and when I toString() the list for parents I get "[name, name. name]". I even went as far as to create a String variable, set it using THE SAME CODE, and then adding teh variable to the column, which works?!
I don't understand what the issue is. Any help would be appreciated.
Please sign in to flag this as inappropriate.