Branch: Tag:

2004-08-07

2004-08-07 15:27:00 by Johan Schön <js@opera.com>

Merge from external js/per/nilsson fork

Rev: lib/modules/Search.pmod/Database.pmod/Base.pike:1.5
Rev: lib/modules/Search.pmod/Database.pmod/Base.pmod:1.20(DEAD)
Rev: lib/modules/Search.pmod/Database.pmod/MySQL.pike:1.77
Rev: lib/modules/Search.pmod/Filter.pmod/Base.pike:1.16
Rev: lib/modules/Search.pmod/Filter.pmod/HTML.pmod:1.37
Rev: lib/modules/Search.pmod/Filter.pmod/Output.pike:1.1
Rev: lib/modules/Search.pmod/Filter.pmod/PDF.pmod:1.16
Rev: lib/modules/Search.pmod/Filter.pmod/PlainText.pmod:1.9
Rev: lib/modules/Search.pmod/Filter.pmod/Word.pmod:1.12
Rev: lib/modules/Search.pmod/Grammar.pmod/AbstractParser.pike:1.7
Rev: lib/modules/Search.pmod/Grammar.pmod/DefaultParser.pike:1.11
Rev: lib/modules/Search.pmod/Grammar.pmod/Lexer.pmod:1.7
Rev: lib/modules/Search.pmod/Grammar.pmod/module.pmod:1.12
Rev: lib/modules/Search.pmod/Indexer.pmod:1.17
Rev: lib/modules/Search.pmod/MergeFile.pike:1.1
Rev: lib/modules/Search.pmod/Process.pmod:1.12
Rev: lib/modules/Search.pmod/Query.pmod:1.26
Rev: src/modules/_WhiteFish/Makefile.in:1.7
Rev: src/modules/_WhiteFish/blob.c:1.34
Rev: src/modules/_WhiteFish/blobs.c:1.12
Rev: src/modules/_WhiteFish/buffer.c:1.13
Rev: src/modules/_WhiteFish/linkfarm.c:1.5
Rev: src/modules/_WhiteFish/resultset.c:1.24
Rev: src/modules/_WhiteFish/resultset.h:1.9
Rev: src/modules/_WhiteFish/whitefish.c:1.35

1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Indexer.pmod,v 1.16 2001/09/25 22:02:37 js Exp $ + // $Id: Indexer.pmod,v 1.17 2004/08/07 15:26:57 js Exp $      //!   void index_document(Search.Database.Base db,
10:    mapping fields)   {    db->remove_document( uri, language ); -  +  int mtime = (int)fields->mtime; +  werror("mtime: %O\n", mtime);    foreach(indices(fields), string field)    {    string f;
20:    db->insert_words(uri, language, field, words );    }    } +  if( mtime ) +  db->set_lastmodified( uri, language, mtime );   // Tokenize any anchor fields -  +    // int source_hash=hash((string)uri)&0xf;   // foreach(indices(uri_anchors|| ({ })), string link_uri)   // {
33:         //! - array(Standards.URI) filter_and_extract_links(Search.Database.Base db, + string extension_to_type(string extension) + { +  return MIME.ext_to_media_type(extension) || "application/octet-stream"; + } +  + //! + string filename_to_type(string filename) + { +  array v=filename/"."; +  if (sizeof(v)<2) return extension_to_type("default"); +  return extension_to_type(v[-1]); + } +  + //! + Search.Filter.Output filter_and_index(Search.Database.Base db,    string|Standards.URI uri,    void|string language,    string|Stdio.File data,    string content_type, -  mapping headers, -  string default_charset ) +  void|mapping headers, +  void|string default_charset )   {    Search.Filter.Base filter=Search.get_filter(content_type);    if(!filter) -  throw("No indexer for content type "+content_type); +  return 0;    -  Search.Filter.Base.Output filteroutput= +  Search.Filter.Output filteroutput=    filter->filter(uri, data, content_type,    headers, default_charset);    index_document(db, uri, language, filteroutput->fields); -  return filteroutput->links; +  return filteroutput;   }      //!