How can I execute a search using Hibernate Search that will NOT retrieve the actual entities from the database and will instead just return the Document cache records for these entities? I am making sure to store the fields that I need inside the index. The database will be active and available during this process, I just wanted to decrease the unnecessary load.
@Column
@Field (index = Index.YES, store = Store.YES)
private String title;
@Id
@Column
@DocumentId
@Field (store = Store.YES)
private String guid;
Session sess = sessionFactory.openSession();
FullTextSession fts = org.hibernate.search.Search.getFullTextSession(sess);
//returns matching Articles from database, how would I retrieve only the index records?
Query query = fts.createFullTextQuery(luceneQuery, Article.class);
Versions:
Hibernate Search 4.1.1.Final
Hibernate Core 4.1.6.Final
Lucene 3.5