<% //Display results table
boolean color = true;
for (int i = 0; i < results.size(); )
{
String last_obj = results.get(i).getFieldValue("meta_cat").toString();
//Display category %>
<%
while (i < results.size() && (last_obj.equals(results.get(i).getFieldValue("meta_cat"))))
{
String id = (String)results.get(i).getFieldValue("id");
//Display category content %>
<% //Print title w/ link
if (results.get(i).getFieldValue("meta_reader") != null)
out.print(""
+ results.get(i).getFieldValue("meta_title")
+ " "
+ faqsWithAttachment.get(id)
+ faqsStatus.get(id) + " ");
else // Title w/o link
out.print(results.get(i).getFieldValue("meta_title"));
//Note : meta_title is allocated with EDEAL object's title in IndexSearch.java
//basing on object's ID. For non EDEAL objects null is replaced by "[x]"
%>
<% //Print text field(s)
String str = "";
if(results.get(i).getFieldValue("all") != null ){
str = results.get(i).getFieldValue("all").toString();
}
//Add highlighting
if ((highlight.get(id) != null)
&& highlight.get(id).get("all") != null)
{
for (String hl : highlight.get(id).get("all")) {
//str = str.replace(hl, "" + hl + "");
}
}
int len=str.length();
str=str.substring(0,(len<250)?len:250);
int startSubstr=(str.startsWith("["))?1:0;
int lenSubstr=(str.endsWith("]"))?1:0;
%>
<%=str.substring(startSubstr,str.length()-lenSubstr)%>...
|
<%=faqsScores.get(id) %>
<%if(!Utils.isEmpty((String)faqsScores.get(id))){ %>
<%} %>
<%=faqsWithComment.get(id)%>
<%if(!Utils.isEmpty((String)faqsTags.get(id))){ %>
: <%=faqsTags.get(id) %>
<%} %>
|
<%
color = !(color);
i++;
}
%> <%
}
%>
|
<%} %>