[sword-devel] clucene-sorting

L.J.Arthur Neil arthurneil at mail.cyberneme.com
Thu Dec 22 03:18:42 MST 2005

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;                }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20051222/30896605/attachment.html

More information about the sword-devel mailing list