pike.git / lib / modules / Search.pmod / Query.pmod

version» Context lines:

pike.git/lib/modules/Search.pmod/Query.pmod:1:   // This file is part of Roxen Search   // Copyright © 2001 - 2009, Roxen IS. All rights reserved.   // - // $Id: Query.pmod,v 1.36 2009/05/25 18:26:52 mast Exp $ + // $Id: Query.pmod,v 1.37 2010/01/20 12:49:40 marty Exp $      static function(string,int:string) blobfeeder(Search.Database.Base db,    array words)   {    mapping state = mkmapping(words,allocate(sizeof(words)));    mapping(string:mapping(int:string)) blobcache = ([ ]);    return lambda( string word, int foo )    {    return db->get_blob(word, state[word]++, blobcache);    };
pike.git/lib/modules/Search.pmod/Query.pmod:55:    Search.ResultSet result =    _WhiteFish.do_query_phrase(words,    ranking->field_ranking,    // ranking->cutoff,    blobfeeder(db, words));    return result;   }      enum search_order   { -  RELEVANCE=1, DATE_ASC, DATE_DESC, NONE +  RELEVANCE=1, DATE_ASC, DATE_DESC, NONE, PUBL_DATE_ASC, PUBL_DATE_DESC   };      static Search.ResultSet sort_resultset(Search.ResultSet resultset,    search_order order,    Search.Database.Base db)   {      }      
pike.git/lib/modules/Search.pmod/Query.pmod:444:    case RELEVANCE:    res[0]->sort();    break;    case DATE_ASC:    case DATE_DESC:    res[0] = res[0]->finalize()->add_ranking(db->get_global_dateset());    if(order==DATE_DESC)    res[0]->sort();    else    res[0]->sort_rev(); +  break; +  +  case PUBL_DATE_ASC: +  case PUBL_DATE_DESC: +  res[0] = res[0]->finalize()->add_ranking(db->get_global_publ_dateset()); +  if(order==PUBL_DATE_DESC) +  res[0]->sort(); +  else +  res[0]->sort_rev(); +  +     case NONE:    }       return res;   }