Hi, i am facing some problems in sorting the results from lucene. I want to sort the result according to the date of an object. I have used "EDITDATE" field for this purpose as shown below:
doc->Add(new Field("EDITDATE",ix->getEditDate(s)->ToString(),Lucene::Net::Documents::Field::Store::NO,Lucene::Net::Documents::Field::Index::UN_TOKENIZED)); I have read in the 'Lucene in Action' that, the field which we are going to use for sorting must be indexed but UN_TOKENIZED. But i get the results in random order... I am using following code in the search app: Query *query = qp->Parse(querydata->ToString()); BooleanQuery *boolquery = new BooleanQuery(); boolquery->Add(query,BooleanClause::Occur::MUST); Sort *sort = new Sort("EDITDATE",true); Hits *hits = searcher->Search(boolquery,sort); So can you please suggest, what is wrong in this example? -- Thanks & Regards... Ravindra V. Gaikwad. S.E., Colayer Gmbh.