Hi All, How can I do soring.I am able to Index and order .But the Sort function doesn't work. I have used the following code; Query* q = QueryParser::parse(tline,_T("contents"),&analyzer); //buf = q->toString(_T("contents")); // _tprintf(_T("Searching for: %s\n\n"), buf); //_CLDELETE_CARRAY(buf); //searcher->setSort(_T("modified")); //SortField *sort_Field = new SortField(_T("modified")); //SortField *sort_Fields = new SortField(*sort_Field); //Sort *sort = new Sort(sort_Field); //sort->setSort( new SortField (_T("modified"), SortField::STRING, true) ); //sort->setSort( _T("modified"),true); //sort->setSort( _T("modified") ); */ Hits* h; try { h = searcher->search(q, sort::INDEXORDER); //h = searcher->search(q); } catch(...) { //printf("err\n"); printf("Unrecoverable error occured!!!Please do search again...\n"); //printf(err.what()); //fflush(stdout); return; }
|
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page