Thanks for replying , i had already seen this page before raising question to the forum. Page explains for one field but what about multiple fields?
I am also trying to find a way to get range of data within cache. Is there any workaround which you can advise ?
the Query module is an experimental integration of the same engine you can find in Hibernate Search, so you could look in http://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/ for more advanced examples of Querying.
To build a Query, you can use several approaches:
- use the DSL functionality of Search to build one programmatically
- use the Lucene API to build one programmatically (requires some Lucene experience)
- use a Lucene QueryParser
regarding ranges, both via the DSL and via the Lucene API you can create a RangeQuery; if the data in the range has to be interpreted as numbers (as opposing to Strings), then make sure to you @NumericField annotations on your Pojo, or to pad the numbers with leading zeros as they will be compared alfabetically (unless you use the NumericField).
If you only want exact matches, and are not interested in advanced fulltext, similarity, language processing or relevance scoring, then you might want to try the Map/Reduce API instead of the Query module.