/ Check-in [b10e31dc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Register any built-in fts5 module before loading automatic extensions. This allows automatic extensions to register fts5 tokenizers and auxiliary functions.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts5-snippet-bias
Files: files | file ages | folders
SHA1: b10e31dce8e590e1ba30f512374a8c16656bcc72
User & Date: dan 2016-08-19 18:37:35
Context
2016-08-20
17:23
Fix other minor problems with the fts5 snippet() function. check-in: b56b2a85 user: dan tags: fts5-snippet-bias
2016-08-19
18:37
Register any built-in fts5 module before loading automatic extensions. This allows automatic extensions to register fts5 tokenizers and auxiliary functions. check-in: b10e31dc user: dan tags: fts5-snippet-bias
14:25
Have the fts5 snippet() function avoid favouring snippets that begin with sentences that do not contain search terms. Add an extra bias in favour of the first sentence in the document. check-in: d8180af2 user: dan tags: fts5-snippet-bias
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  2944   2944   
  2945   2945     /* Register all built-in functions, but do not attempt to read the
  2946   2946     ** database schema yet. This is delayed until the first time the database
  2947   2947     ** is accessed.
  2948   2948     */
  2949   2949     sqlite3Error(db, SQLITE_OK);
  2950   2950     sqlite3RegisterPerConnectionBuiltinFunctions(db);
         2951  +  rc = sqlite3_errcode(db);
         2952  +
         2953  +#ifdef SQLITE_ENABLE_FTS5
         2954  +  /* Register any built-in FTS5 module before loading the automatic
         2955  +  ** extensions. This allows automatic extensions to register FTS5 
         2956  +  ** tokenizers and auxiliary functions.  */
         2957  +  if( !db->mallocFailed && rc==SQLITE_OK ){
         2958  +    rc = sqlite3Fts5Init(db);
         2959  +  }
         2960  +#endif
  2951   2961   
  2952   2962     /* Load automatic extensions - extensions that have been registered
  2953   2963     ** using the sqlite3_automatic_extension() API.
  2954   2964     */
  2955         -  rc = sqlite3_errcode(db);
  2956   2965     if( rc==SQLITE_OK ){
  2957   2966       sqlite3AutoLoadExtensions(db);
  2958   2967       rc = sqlite3_errcode(db);
  2959   2968       if( rc!=SQLITE_OK ){
  2960   2969         goto opendb_out;
  2961   2970       }
  2962   2971     }
................................................................................
  2975   2984     }
  2976   2985   #endif
  2977   2986   
  2978   2987   #ifdef SQLITE_ENABLE_FTS3 /* automatically defined by SQLITE_ENABLE_FTS4 */
  2979   2988     if( !db->mallocFailed && rc==SQLITE_OK ){
  2980   2989       rc = sqlite3Fts3Init(db);
  2981   2990     }
  2982         -#endif
  2983         -
  2984         -#ifdef SQLITE_ENABLE_FTS5
  2985         -  if( !db->mallocFailed && rc==SQLITE_OK ){
  2986         -    rc = sqlite3Fts5Init(db);
  2987         -  }
  2988   2991   #endif
  2989   2992   
  2990   2993   #ifdef SQLITE_ENABLE_ICU
  2991   2994     if( !db->mallocFailed && rc==SQLITE_OK ){
  2992   2995       rc = sqlite3IcuInit(db);
  2993   2996     }
  2994   2997   #endif