Allowing WHERE clause on criteria set by SetCriteriaQuery
Description
The comments for IFullTextQuery.SetCriteriaQuery say "no where clause may be defined". This appears to be only because the of way QueryLoader handles ordering the results. Attached is a patch that changes the way ordering is applied, allowing such WHERE clauses.
At the point at which i have made code changes, there was a comment "// TODO: Would it be faster to keep the list and then sort it?"
Perhaps my attached patch is not the most efficient way of ordering the results, and i welcome any performance improvements. However, as it adds the ability to do additional WHERE clauses directly into NH (rather than Lucene) I feel this is a massive improvement.
Also included in the patch is a bugfix for FullTextQueryImpl which when checking the criteria's type against the index type, it was using MemberInfo.Name instead of FullName.
The comments for IFullTextQuery.SetCriteriaQuery say "no where clause may be defined". This appears to be only because the of way QueryLoader handles ordering the results. Attached is a patch that changes the way ordering is applied, allowing such WHERE clauses.
At the point at which i have made code changes, there was a comment "// TODO: Would it be faster to keep the list and then sort it?"
Perhaps my attached patch is not the most efficient way of ordering the results, and i welcome any performance improvements. However, as it adds the ability to do additional WHERE clauses directly into NH (rather than Lucene) I feel this is a massive improvement.
Also included in the patch is a bugfix for FullTextQueryImpl which when checking the criteria's type against the index type, it was using MemberInfo.Name instead of FullName.