From 7a9966bbe3cbfeb1f82f81d49094f50fce387118 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 1 Feb 2014 03:12:02 -0500 Subject: [PATCH] Fix indexing error adding items with repeated words Probably words that didn't make it into the same in-memory insertion batch, since the UNION would make those distinct. Follow up to #440 --- chrome/content/zotero/xpcom/fulltext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js index cb9891f324..207813d13d 100644 --- a/chrome/content/zotero/xpcom/fulltext.js +++ b/chrome/content/zotero/xpcom/fulltext.js @@ -266,7 +266,7 @@ Zotero.Fulltext = new function(){ } Zotero.DB.query('INSERT OR IGNORE INTO fulltextWords (word) SELECT word FROM indexing.fulltextWords'); Zotero.DB.query('DELETE FROM fulltextItemWords WHERE itemID = ?', [itemID]); - Zotero.DB.query('INSERT INTO fulltextItemWords (wordID, itemID) SELECT wordID, ? FROM fulltextWords JOIN indexing.fulltextWords USING(word)', [itemID]); + Zotero.DB.query('INSERT OR IGNORE INTO fulltextItemWords (wordID, itemID) SELECT wordID, ? FROM fulltextWords JOIN indexing.fulltextWords USING(word)', [itemID]); Zotero.DB.query("REPLACE INTO fulltextItems (itemID, version) VALUES (?,?)", [itemID, 0]); Zotero.DB.query("DELETE FROM indexing.fulltextWords");