-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: [HSearch] entity loaded directly from index files
PostPosted: Thu Apr 19, 2012 9:51 am 
Newbie

Joined: Wed Mar 08, 2006 11:12 am
Posts: 16
Hi,
we successfully use HibernateSearch 4.0.0 and HibernateCore 4.0.1 in our project. We have several db entities configured for HSearch and everything works fine as expected.

And now I have to integrate one special entity, not mapped to db table. This entity represents html page and all data are stored directly in lucene index files. The indexing logic is already implemented and index files are stored correctly (proven in Luke tool).

Is there a way how to say Hibernate or HibernateSearch that all searchable entities are fetched from database as usual, but this very special entity directly from index files? We only use 'multifield queries' above all 'search enabled' entities.

My idea was to implement custom Loader, but I haven't found a way how to register custom Loader to specific entity, only to patch code of FullTextQueryImpl class. But I would prefer other solution.

Have I missed anything?

Thanx for any hint


Top
 Profile  
 
 Post subject: Re: [HSearch] entity loaded directly from index files
PostPosted: Mon Apr 23, 2012 6:26 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
you should use Projections: http://docs.jboss.org/hibernate/search/ ... rojections
you can load any stored field via projections withouth havint it try to load anything from the database.

Out of curiosity, how did you implement the indexing logic for this "special entity"?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: [HSearch] entity loaded directly from index files
PostPosted: Tue Apr 24, 2012 4:59 am 
Newbie

Joined: Wed Mar 08, 2006 11:12 am
Posts: 16
Hi and thanx for your answer.

I solved my issue in between using EntityPersister from Hibernate Core. There I can implement a way how this entity is fetched - e.g. from lucene index files.
Seems to work so far :).


About creation of these 'special' indexes. We have a logic (based directly on lucene) that downloads html pages and indexes their content into index files. The structure of these index files corresponds with the structure that HSearch generates as I can control it in lucene.


Top
 Profile  
 
 Post subject: Re: [HSearch] entity loaded directly from index files
PostPosted: Tue Apr 24, 2012 5:23 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
About creation of these 'special' indexes. We have a logic (based directly on lucene) that downloads html pages and indexes their content into index files. The structure of these index files corresponds with the structure that HSearch generates as I can control it in lucene.


I see, cool. You could take advantage of the IndexWriter management and async pipelines of Hibernate Search by sending "Work" operations directly to the backend, see how org.hibernate.search.backend.impl.BatchedQueueingProcessor is being used.. unless you already have a state of the art writer management that could buy you some extra performance and better integration with the other services (like NRT readers and exclusive writers).

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.