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.18 2001/07/05 00:47:58 nilsson Exp $ + // $Id: Query.pmod,v 1.19 2001/08/07 14:33:33 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:74:   //! @elem Search.ResultSet 0   //! The ResultSet containing the hits.   //! @elem array(string) 1   //! All wanted words in the query. (I.e. not the words that were   //! preceded by minus.)   //! @endarray   //!   array(Search.ResultSet|array(string)) execute(Search.Database.Base db,    Search.Grammar.AbstractParser parser,    string query, -  Search.RankingProfile defaultRanking) +  Search.RankingProfile defaultRanking, +  array(string)|void stop_words)   {    Search.Grammar.ParseNode q = parser->parse(query); -  +  if (stop_words && sizeof(stop_words)) { +  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       string error = Search.Grammar.validate(q);    if (error)    throw (error);