Details
Description
Lucene uses complex ranking using search results and field boosts - using sorting in lucene query is NOT a valid approach.
Category ranking should add to Boost! not sorting since we would like to increate the probability of the product to be in the top search results. Adding sorting kills all that statistical calculation and hence defies the point of having full search index!
We should NEVER use sorting in full text queries (maybe only in YUM)
SortableProductDataProvider
} else {
products = decorate(productService.getProductByQuery(
query,
first,
count,
sortFieldName,
reverse));
GenericDAOHibernateImpl
public List<T> fullTextSearch(final org.apache.lucene.search.Query query,
final int firtsResult,
final int maxResults,
final String sortFieldName,
final boolean reverse) {
if (null != getPersistentClass().getAnnotation(org.hibernate.search.annotations.Indexed.class)) {
FullTextSession fullTextSession = Search.getFullTextSession(sessionFactory.getCurrentSession());
FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(query, getPersistentClass());
if (sortFieldName != null)