Dear fellow Jahia template developers,
I am currently experiencing a problem in our Jahia 4.1 environment. I
created a template with a container list and a text field on the page
through which the user can search through the container list. The
container list on my page contains a subcontainer list for each item.
The problem is that the search functionality fails to search through the
sublists. It only searches through fields of the outer list, not in
fields of the inner list. This is what the container definition looks
like:
<content:declareContainerList name='sfrrList'
titleKey="com.loqutus.mfce.jahia.contentContainerListName"
title="Service Field Report Register"
bundleKey="<%=portalResourceBundleID%>">
<content:declareContainer>
<content:declareField name='sfrrModels' title="Models"
type="SharedSmallText" />
<content:declareField name='sfrrSubject' title="Subject"
type="SharedSmallText" />
<content:declareField name='sfrrMcfeSfrNo' title="MCFE SFR No"
type="SharedSmallText" />
<content:declareField name='sfrrDate' title="Date"
type="Date" value='<jahia_calendar[mon yyyy]>' />
<content:declareContainerList name='sfrrCommentList'
titleKey="com.loqutus.mfce.jahia.contentContainerListName"
title="Comments" bundleKey="<%=portalResourceBundleID%>">
<content:declareContainer>
<content:declareField name='sfrrCommentDate'
title="CommentDate" type="Date" value='<jahia_calendar[dd mon yyyy]>'
/>
<content:declareField name='sfrrCommentDescr'
title="CommentDescr" type="BigText" />
</content:declareContainer>
</content:declareContainerList>
</content:declareContainer>
</content:declareContainerList>
This is the code to search through sfrrList (the outer list):
/* begin extract */
String searchQuery =
request.getParameter(JahiaSearchConstant.CLIST_SEARCHQUERY_INPUT_PREFIX
+ "sfrrList");
if (searchQuery != null && !"".equals(searchQuery.trim())) {
if (searchQuery.indexOf('*') < 0) {
//adding a wildcard to the last word because lucene will try to
match whole words by default
searchQuery += "*";
}
ContainerSearcher cSearcher = new ContainerSearcher("sfrrList",
jParams, searchQuery, jParams.getEntryLoadRequest());
request.setAttribute("sfrrList_search_handler",cSearcher);
}
/* end extract */
My question is: how can I make the ContainerSearch also search through
the inner container list (sfrrCommentsList)? I tried using a different
container searcher constructor, but that did not help.
Any help with this would be greatly appreciated.
Regards,
Max.
_______________________________________________
template_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/template_list