JPM/HM: Custom Similarity class with ranking based on matching terms in query