Announcement Announcement Module
Collapse
No announcement yet.
Spring Mongo regex space problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Mongo regex space problem

    Hello,

    I am using Spring data for MongoDB operation,

    the Critiria is as follows:
    Code:
    Criteria.where("name").regex(searchvalue, "i")
    While performing a search operation , with a search condition that contain
    space in between the results are not getting fetched.
    for example, if I i have 2 values "medicine bills" and "medicine" in the same collection. If I search for medicine, it returns medicine bills(medicine bills is found before medicine in the collection). same way if I have bills and then bill status, bills gets returned when I search for bill status. Please help
    Code:
    Query query = new Query( Criteria.where(propName).regex(value.toString(), "i")); 
    return  template.find(query,some.class);
    Last edited by rrjois.19; Aug 1st, 2012, 06:03 AM.
Working...
X