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 Roxen IS. All rights reserved.   // - // $Id: Query.pmod,v 1.19 2001/08/07 14:33:33 norlin Exp $ + // $Id: Query.pmod,v 1.20 2001/08/08 14:42:02 norlin Exp $      static function(string,int:string) blobfeeder(Search.Database.Base db, array words)   {    mapping state = mkmapping(words,allocate(sizeof(words)));    return lambda( string word, int foo )    {    return db->get_blob(word, state[word]++);    };   }   
pike.git/lib/modules/Search.pmod/Query.pmod:89:    werror ("Query BEFORE stop word removal:\n%O\n", q->print());    q = Search.Grammar.remove_stop_words(q, stop_words);    werror ("Query AFTER stop word removal:\n%O\n", q->print());    }       q = Search.Grammar.optimize(q);       if (!q) // The query was a null query    return ({ Search.ResultSet(), ({}) }); // so return an empty resultset    +  werror("Query.execute:\n%s\n", q->print()); +     string error = Search.Grammar.validate(q);    if (error)    throw (error);       return class {    static Search.RankingProfile defaultRanking;    static Search.Database.Base db;       // Used when search is limited to another field than "any:".    static Search.RankingProfile specialRanking;
pike.git/lib/modules/Search.pmod/Query.pmod:182:    Search.RankingProfile ranking = defaultRanking;       if (q->field != "any") {    ranking = specialRanking;    int fieldID = db->get_field_id(q->field, 1);    if (!fieldID && q->field != "body") {    // There was no such field, so we push an empty ResultSet !    push(Search.ResultSet());    break;    } -  ranking->field_ranking = allocate(66); +  ranking->field_ranking = allocate(65);       ranking->field_ranking[fieldID] = defaultRanking->field_ranking[fieldID];    // ranking->field_ranking[fieldID] = 1;    }       int hasPlus = sizeof(q->plusWords) || sizeof(q->plusPhrases);    int hasOrdinary = sizeof(q->words) || sizeof(q->phrases);    int hasMinus = sizeof(q->minusWords) || sizeof(q->minusPhrases);    if (hasPlus) {    int first = 1;