I need to select only few columns using hibernate search. Following is the code which works fine
FullTextSession fts = org.hibernate.search.Search.getFullTextSession(getSession());
org.apache.lucene.search.BooleanQuery query = prepareQuery(dto);
fullTextQuery = fts.createFullTextQuery(query, ProfileBean.class);
fullTextQuery.setFirstResult(dto.getProfileBean().getResultStartIndex());
fullTextQuery.setMaxResults(dto.getProfileBean().getResultsLimit());
List<ProfileBean> profiles = fullTextQuery.list();
In the above case I only want to select columns 'firstName' and 'lastName'.
Following code throws an exception
List<String> projectedFields = new ArrayList<String>();
projectedFields.add("firstName");
projectedFields.add("lastName");
org.hibernate.search.SearchException: Projecting an unstored field: firstName
actually i don't want to store the firstName field in lucene any other suggession.?