Fossil

Check-in [2d3dc9b0]
Login

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

Overview
Comment:When searching documents, always use the file name as the title in the results. In general, always prefer to use the name as the title, when non-NULL.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | titleAdj
Files: files | file ages | folders
SHA1: 2d3dc9b00d736ed8d84ac909fbdebfd0d5eeeb21
User & Date: mistachkin 2015-04-01 02:45:30
Context
2015-04-01
02:45
When searching documents, always use the file name as the title in the results. In general, always prefer to use the name as the title, when non-NULL. Closed-Leaf check-in: 2d3dc9b0 user: mistachkin tags: titleAdj
2015-03-31
17:15
Merge fork on blitz skin updates. check-in: e7d5fcf7 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/search.c.

448
449
450
451
452
453
454




455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
                      SQLITE_TRANSIENT);
}
static void search_title_sqlfunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){




  const char *zType = (const char*)sqlite3_value_text(argv[0]);
  int rid = sqlite3_value_int(argv[1]);
  const char *zName = (const char*)sqlite3_value_text(argv[2]);
  int nHdr;
  char *z = search_stext_cached(zType[0], rid, zName, &nHdr);
  if( nHdr || zType[0]!='d' ){
    sqlite3_result_text(context, z, nHdr, SQLITE_TRANSIENT);
  }else{
    sqlite3_result_value(context, argv[2]);
  }
}
static void search_body_sqlfunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){







>
>
>
>
|
|
<
<
|
<

<
<







448
449
450
451
452
453
454
455
456
457
458
459
460


461

462


463
464
465
466
467
468
469
                      SQLITE_TRANSIENT);
}
static void search_title_sqlfunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  const char *zName = (const char*)sqlite3_value_text(argv[2]);
  if( zName ){
    sqlite3_result_text(context, zName, -1, SQLITE_TRANSIENT);
  }else{
    const char *zType = (const char*)sqlite3_value_text(argv[0]);
    int nHdr = 0, rid = sqlite3_value_int(argv[1]);


    char *z = search_stext_cached(zType[0], rid, zName, &nHdr);

    sqlite3_result_text(context, z, nHdr, SQLITE_TRANSIENT);


  }
}
static void search_body_sqlfunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){