<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><PRE><FONT size=3>Hi All,</FONT></PRE><PRE><FONT size=3>How can I do soring.I am able to Index and order .But the Sort function doesn't work.</FONT></PRE><PRE><FONT size=3>I have used the following code;</FONT></PRE><PRE><FONT size=3> Query* q = QueryParser::parse(tline,_T("contents"),&analyzer);</FONT></PRE><PRE><FONT size=3> //buf = q->toString(_T("contents"));<BR> // _tprintf(_T("Searching for: %s\n\n"), buf);<BR> //_CLDELETE_CARRAY(buf);</FONT></PRE><PRE><FONT size=3> //searcher->setSort(_T("modified"));<BR> //SortField *sort_Field = new SortField(_T("modified"));<BR> //SortField *sort_Fields = new SortField(*sort_Field);<BR> //Sort *sort = new Sort(sort_Field);<BR> //sort->setSort( new SortField (_T("modified"), SortField::STRING, true) );<BR> //sort->setSort( _T("modified"),true);<BR> //sort->setSort( _T("modified") ); */<BR> Hits* h;<BR> try<BR> {<BR> h = searcher->search(q, sort::INDEXORDER);<BR> //h = searcher->search(q);<BR> }<BR> catch(...)<BR> {<BR> //printf("err\n");<BR> printf("Unrecoverable error occured!!!Please do search again...\n");<BR> //printf(err.what());<BR> //fflush(stdout);<BR> return;<BR> }<BR></FONT></PRE><PRE><FONT size=3></FONT> </PRE><PRE><FONT size=3></FONT> </PRE></FONT></DIV></BODY></HTML>