Fossil SCM

Put a warning at the bottom of the /setup_chat page if FTS entries for chat are missing.

drh 2025-12-11 12:51 trunk
Commit d5504f9deb324a85369da06d5457eb6d014e6f1a5ba5e878fe4bf3a0f543a202
1 file changed +17
+17
--- src/setup.c
+++ src/setup.c
@@ -1652,10 +1652,27 @@
16521652
@ <hr/>
16531653
@ <p><input type="submit" name="submit" value="Apply Changes">
16541654
@ <input type="submit" name="rbldchatidx"\
16551655
@ value="Rebuild Full-Text Search Index"></p>
16561656
@ </div></form>
1657
+
1658
+ /* Validate the chat FTS search index */
1659
+ if( db_table_exists("repository","chatfts1") ){
1660
+ char *zMissing;
1661
+ zMissing = db_text(0,
1662
+ "SELECT group_concat(rowid,', ') FROM chat"
1663
+ " WHERE rowid NOT IN (SELECT rowid FROM chatfts1_docsize)"
1664
+ );
1665
+ if( zMissing && zMissing[0] ){
1666
+ @ <p><b>WARNING:</b> The following chat messages are missing
1667
+ @ from the full-text index. Press the "Rebuild Full-Text Search Index"
1668
+ @ button above to fix this.</p>
1669
+ @ <p>%h(zMissing)</p>
1670
+ }
1671
+ fossil_free(zMissing);
1672
+ }
1673
+
16571674
db_end_transaction(0);
16581675
@ <script nonce="%h(style_nonce())">
16591676
@ (function(){
16601677
@ var w = document.getElementById('idsnd');
16611678
@ w.onchange = function(){
16621679
--- src/setup.c
+++ src/setup.c
@@ -1652,10 +1652,27 @@
1652 @ <hr/>
1653 @ <p><input type="submit" name="submit" value="Apply Changes">
1654 @ <input type="submit" name="rbldchatidx"\
1655 @ value="Rebuild Full-Text Search Index"></p>
1656 @ </div></form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1657 db_end_transaction(0);
1658 @ <script nonce="%h(style_nonce())">
1659 @ (function(){
1660 @ var w = document.getElementById('idsnd');
1661 @ w.onchange = function(){
1662
--- src/setup.c
+++ src/setup.c
@@ -1652,10 +1652,27 @@
1652 @ <hr/>
1653 @ <p><input type="submit" name="submit" value="Apply Changes">
1654 @ <input type="submit" name="rbldchatidx"\
1655 @ value="Rebuild Full-Text Search Index"></p>
1656 @ </div></form>
1657
1658 /* Validate the chat FTS search index */
1659 if( db_table_exists("repository","chatfts1") ){
1660 char *zMissing;
1661 zMissing = db_text(0,
1662 "SELECT group_concat(rowid,', ') FROM chat"
1663 " WHERE rowid NOT IN (SELECT rowid FROM chatfts1_docsize)"
1664 );
1665 if( zMissing && zMissing[0] ){
1666 @ <p><b>WARNING:</b> The following chat messages are missing
1667 @ from the full-text index. Press the "Rebuild Full-Text Search Index"
1668 @ button above to fix this.</p>
1669 @ <p>%h(zMissing)</p>
1670 }
1671 fossil_free(zMissing);
1672 }
1673
1674 db_end_transaction(0);
1675 @ <script nonce="%h(style_nonce())">
1676 @ (function(){
1677 @ var w = document.getElementById('idsnd');
1678 @ w.onchange = function(){
1679

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button