lucene.net - Getting no results by NumericRangeQuery in Lucene -
i using below code creating index on listingid
lucene.net.documents.document doc = new lucene.net.documents.document(); numericfield numberfield = new numericfield("listing_id", field.store.yes, true); numberfield.setdoublevalue(fieldnumber);// .setdoublevalue(15, 25, 21, 51, etc. ); // here fieldnumber getting database doc.add(numberfield);
this code using in search:
string indexfilelocation = server.mappath("~/searchindex/"); lucene.net.store.directory dir = lucene.net.store.fsdirectory.getdirectory(indexfilelocation,false); indexsearcher indexsearcher = new indexsearcher(dir,true); numericrangequery query = numericrangequery.newdoublerange("listing_id", 1, 6, true, true); var hits = indexsearcher.search(query);
but getting no results in search.
Comments
Post a Comment