-2

I have a Double field price in my entity class with annotation @Field. Now I need a query which will be used to retrieve product based on the price range provided by the user.

I am new to this QueryBuilder things in hibernate search and I couldn't find out the exact answer I am looking for. I am using hibernate search with Lucene Index. This question may be a duplicate one but actually I don't know where to begin and how. I appreciate any sort of help about this!

Sanne
  • 6,027
  • 19
  • 34
bivrantoshakil
  • 421
  • 1
  • 5
  • 10
  • programming is not about copying ready stuff, if you dont know where to start, start at the beginning.... get a hibernate tutorial, and go through it, precise questions will arise automatically, solutions shortly later. Question flagged to close so far. – mikus Nov 25 '15 at 14:04

1 Answers1

1
Query query = queryBuilder
    .range()
    .onField("myField")
    .from(x).to(y).excludeLimit()
    .createQuery();

See the docs, Chapter 5 (Section 5.1.2.5, in particular, though you likely should read the rest of it as well).

femtoRgon
  • 32,893
  • 7
  • 60
  • 87