0

In my pageSearch there is my value which I have to search and the country is my column name and FilterOperator is my Filteration ,If I type "A"(uppercase and lowercase) then it should give value starting with the value "A" that's what I need it.

   Query query=new       Query("customerRolodex").addFilter("country",FilterOperator.EQUAL,pageSearch);//.setFilter(c_r);
   PreparedQuery pq=ds.prepare(query);
   for(Entity result:pq.asIterable()){
     //here i m using json to send and printing data; 
           p=new cust_rolo();
       p.setCountry(result.getProperty("country").toString());
       p.setRegion(result.getProperty("region").toString());
        list.add(p);

  }
   json.put("rows", list);
   out.print(json.toString()); 

Any help would be appreciated and also I applied Greater than or Equal to operator for this

Dan McGrath
  • 37,828
  • 10
  • 90
  • 123
ashishSober
  • 981
  • 1
  • 9
  • 23

1 Answers1

1

You should use query between a range of values:

.addFilter("country", FilterOperator.GREATER_THAN_OR_EQUAL, pageSearch)
.addFilter("country", FilterOperator.LESS_THAN, pageSearch + "\uffff")
Peter Knego
  • 78,855
  • 10
  • 118
  • 147
  • that's really help me a lot,thank you so much.Would tell me y we need "\uffff" there,and If I wanted to apply equalsIgnoreCase then what we need to do. @Peter Knego – ashishSober Aug 20 '14 at 09:59