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
This commit is contained in:
Dan Stillman 2014-02-01 03:12:02 -05:00
parent d7ce74f1c5
commit 7a9966bbe3

View file

@ -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");