Fossil SCM
Add a control to the /srchsetup page that allows the full-text index to be created and destroyed.
Commit
ef78fba86a7fff99e0cfa80da6b75038c480efee
Parent
1b08cfe21550047…
1 file changed
+19
+19
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -2206,8 +2206,27 @@ | ||
| 2206 | 2206 | onoff_attribute("Search Tickets", "search-tkt", "st", 0, 0); |
| 2207 | 2207 | @ <br> |
| 2208 | 2208 | onoff_attribute("Search Wiki","search-wiki", "sw", 0, 0); |
| 2209 | 2209 | @ <hr/> |
| 2210 | 2210 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 2211 | + @ <hr/> | |
| 2212 | + if( P("fts0") ){ | |
| 2213 | + search_drop_index(); | |
| 2214 | + }else if( P("fts1") ){ | |
| 2215 | + search_drop_index(); | |
| 2216 | + search_create_index(); | |
| 2217 | + search_fill_index(); | |
| 2218 | + search_update_index(SRCH_ALL); | |
| 2219 | + } | |
| 2220 | + if( search_index_exists() ){ | |
| 2221 | + @ <p>Currently using an SQLite FTS4 search index. This makes search | |
| 2222 | + @ run faster, especially on large repositories, but takes up space.</p> | |
| 2223 | + @ <p><input type="submit" name="fts0" value="Delete The Full-Text Index"> | |
| 2224 | + }else{ | |
| 2225 | + @ <p>The SQLite FTS4 search index is disabled. All searching will be | |
| 2226 | + @ a full-text scan. This usually works fine, but can be slow for | |
| 2227 | + @ larger repositories.</p> | |
| 2228 | + @ <p><input type="submit" name="fts1" value="Create A Full-Text Index"> | |
| 2229 | + } | |
| 2211 | 2230 | @ </div></form> |
| 2212 | 2231 | style_footer(); |
| 2213 | 2232 | } |
| 2214 | 2233 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -2206,8 +2206,27 @@ | |
| 2206 | onoff_attribute("Search Tickets", "search-tkt", "st", 0, 0); |
| 2207 | @ <br> |
| 2208 | onoff_attribute("Search Wiki","search-wiki", "sw", 0, 0); |
| 2209 | @ <hr/> |
| 2210 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 2211 | @ </div></form> |
| 2212 | style_footer(); |
| 2213 | } |
| 2214 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -2206,8 +2206,27 @@ | |
| 2206 | onoff_attribute("Search Tickets", "search-tkt", "st", 0, 0); |
| 2207 | @ <br> |
| 2208 | onoff_attribute("Search Wiki","search-wiki", "sw", 0, 0); |
| 2209 | @ <hr/> |
| 2210 | @ <p><input type="submit" name="submit" value="Apply Changes" /></p> |
| 2211 | @ <hr/> |
| 2212 | if( P("fts0") ){ |
| 2213 | search_drop_index(); |
| 2214 | }else if( P("fts1") ){ |
| 2215 | search_drop_index(); |
| 2216 | search_create_index(); |
| 2217 | search_fill_index(); |
| 2218 | search_update_index(SRCH_ALL); |
| 2219 | } |
| 2220 | if( search_index_exists() ){ |
| 2221 | @ <p>Currently using an SQLite FTS4 search index. This makes search |
| 2222 | @ run faster, especially on large repositories, but takes up space.</p> |
| 2223 | @ <p><input type="submit" name="fts0" value="Delete The Full-Text Index"> |
| 2224 | }else{ |
| 2225 | @ <p>The SQLite FTS4 search index is disabled. All searching will be |
| 2226 | @ a full-text scan. This usually works fine, but can be slow for |
| 2227 | @ larger repositories.</p> |
| 2228 | @ <p><input type="submit" name="fts1" value="Create A Full-Text Index"> |
| 2229 | } |
| 2230 | @ </div></form> |
| 2231 | style_footer(); |
| 2232 | } |
| 2233 |