Hi,
I am trying to search across some documents and have min and max experience, min and max ctc and email as some of the search fields. I have problem using the Range Query. The problem is as follows. If I am trying to search for documents with exp between 0 to 9, I get 15 hits, assuming that all 15 documents are with exp between 3 and 8, but if I change my range to 0 to 20, I do not get any results. Seems odd to me.anything between 0 to 9 is also between 0 to 20. Now, if I change my range to 0 to 90, I get all 15 records again. I guess is that somehow the code is not taking my range as numerals but is probably doing string compare. The code snipped is listed below. Any help will be much appreciated. Thanks in advance. BooleanQuery documentSearchQuery = new BooleanQuery(); . if (minExperience >= 0 && maxExperience >= 0) { queryExperience = new RangeQuery(new Term(IndexerColumns.experience, String.valueOf(minExperience)), new Term( IndexerColumns.experience, String.valueOf(maxExperience)), true); documentSearchQuery.add(queryExperience, true, false); } if (minCtc >= 0 && maxCtc >= 0) { queryCtc = new RangeQuery(new Term(IndexerColumns.ctc, String.valueOf(minCtc)), new Term(IndexerColumns.ctc, String.valueOf(maxCtc)), true); documentSearchQuery.add(queryCtc, true, false); } if (emailId != null && !emailId.trim().equals("")) { try { queryEmailId = QueryParser.parse(getQueryString(criteriaForTermFields, emailId), IndexerColumns.emailId, new StandardAnalyzer()); } catch (ParseException e2) { e2.printStackTrace(); } documentSearchQuery.add(queryEmailId, true, false); } Hits hits = null; try { hits = indexsearcher.search(documentSearchQuery); } catch (IOException e3) { e3.printStackTrace(); throw new Error("Exception in search().." + e3.getMessage()); } Regards, Shivani