[jboss-user] [JBoss Seam] - Re: Hibernate Search and JBoss Seam example

brachie do-not-reply at jboss.com
Tue Sep 18 09:27:22 EDT 2007


Hi Seam-users,

I have a question concerning hibernate search and thought is would fit best in this thread.

In my app I want to use a projection for a FullTextQuery to retrieve the search score of the results. What I do is the following:


  | @Datamodel
  | List<Object[]> searchResults;
  | ...
  | query = searchQuery(buildLuceneSearchString());
  |          query.setProjection(FullTextQuery.SCORE, FullTextQuery.THIS);
  |          searchResults= query.setMaxResults(pageSize + 1).setFirstResult(pageSize * currentPage).list();
  | ... 
  | 

To output the score and persons data in the JSF I do: 

  | ...
  | <rich:dataTable id="searchResults" rows="10" value="#{searchResults}" var="person" rendered="#{searchResults !=null and searchResults.rowCount gt 0}">
  | <rich:column>
  |    <f:facet name="header">Score</f:facet>
  |    <h:outputText value="#{person[0]}" />
  | </rich:column>
  | <rich:column>
  |    <f:facet name="header">Name</f:facet>
  |    <h:outputText value="#{person[1].vorName}" />
  | </rich:column>
  | <rich:column>
  |    <f:facet name="header">Nachname</f:facet>
  |    <h:outputText value="#{person[1].nachName}" />
  | </rich:column>
  | ... 
  | 

Unfortunately this gives me an error while rendering the JSF. Is there anybody who have tried such a projection with Hibernate search and representing the results in JSF? Is the EL correct to access the data in the JSF?

Thanks & Regards,

Alexander

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085490#4085490

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4085490



More information about the jboss-user mailing list