You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lance Java <la...@googlemail.com> on 2012/10/01 09:58:24 UTC

Re: LUCENE SEARCH component

Although I've not used it, hibernate does have lucene integration
(http://docs.jboss.org/hibernate/search/3.3/reference/en-US/html/search-query.html#search-query-lucene-api)

Tapestry creates a proxy around hibernate's session and users on this list
have reported that Search.getFullTextSession(session) does not work with the
session proxy.

If you add the following to your AppModule:

public static FullTextSession buildFullTextSession(final
HibernateSessionManager sessionManager, PropertyShadowBuilder
propertyShadowBuilder) { 
   Object lazyLoader = new Object() { 
      public FullTextSession getFullTextSession() { 
         // sessionManager is per thread 
         return Search.getFullTextSession(sessionManager.getSession()); 
      } 
   }; 
   return propertyShadowBuilder.build(lazyLoader, "fullTextSession",
FullTextSession.class); 
}

You *should* be able to @Inject FullTextSession into your
pages/components/services.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/LUCENE-SEARCH-component-tp5716563p5716574.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: LUCENE SEARCH component

Posted by Kalle Korhonen <ka...@gmail.com>.
Incidentally I'm just working on full text search in Tynamo's
tapestry-model trunk. The approach Lance mentions works fine. However,
I'm currently looking into migrating to ElasticSearch. HibernateSearch
only offers result coercion to entities, not much else.

Kalle


On Mon, Oct 1, 2012 at 12:58 AM, Lance Java <la...@googlemail.com> wrote:
> Although I've not used it, hibernate does have lucene integration
> (http://docs.jboss.org/hibernate/search/3.3/reference/en-US/html/search-query.html#search-query-lucene-api)
>
> Tapestry creates a proxy around hibernate's session and users on this list
> have reported that Search.getFullTextSession(session) does not work with the
> session proxy.
>
> If you add the following to your AppModule:
>
> public static FullTextSession buildFullTextSession(final
> HibernateSessionManager sessionManager, PropertyShadowBuilder
> propertyShadowBuilder) {
>    Object lazyLoader = new Object() {
>       public FullTextSession getFullTextSession() {
>          // sessionManager is per thread
>          return Search.getFullTextSession(sessionManager.getSession());
>       }
>    };
>    return propertyShadowBuilder.build(lazyLoader, "fullTextSession",
> FullTextSession.class);
> }
>
> You *should* be able to @Inject FullTextSession into your
> pages/components/services.
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/LUCENE-SEARCH-component-tp5716563p5716574.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org