summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ed593d3)
raw | patch | inline | side by side (parent: ed593d3)
author | ber <ber@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 1 Jul 2011 13:23:09 +0000 (13:23 +0000) | ||
committer | ber <ber@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 1 Jul 2011 13:23:09 +0000 (13:23 +0000) |
Closes issue2550687. Thanks to Olly Betts for the patch.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4623 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4623 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/backends/indexer_xapian.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index c1f7d8bf82c825f4a6de46a1d22e4fc5f2a97dbf..7a8597a7c87648bbc217ce352a6154a18e34024a 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
2011-XX-XX 1.4.19 (r46XX)
+Features:
+
+- Xapian indexing improved: Slightly faster and slightly smaller database.
+ Closes issue2550687. Thanks to Olly Betts for the patch. (Bernhard Reiter)
+
Fixed:
- Updated the url to point to www.roundup-tracker.org in two places in the
index 4116b1c36e575ce3a03abcb54795c7f544bf67c7..f071baa6923b38dcd21a8a33338cb5b9eb3dfdad 100644 (file)
# indexed so we know what we're matching when we get results
identifier = '%s:%s:%s'%identifier
- # see if the id is in the database
- enquire = xapian.Enquire(database)
- query = xapian.Query(xapian.Query.OP_AND, [identifier])
- enquire.set_query(query)
- matches = enquire.get_mset(0, 10)
- if len(matches):
- docid = matches[0].docid
- else:
- docid = None
-
# create the new document
doc = xapian.Document()
doc.set_data(identifier)
- doc.add_posting(identifier, 0)
+ doc.add_term(identifier, 0)
for match in re.finditer(r'\b\w{%d,%d}\b'
% (self.minlength, self.maxlength),
continue
term = stemmer(word)
doc.add_posting(term, match.start(0))
- if docid:
- database.replace_document(docid, doc)
- else:
- database.add_document(doc)
+
+ database.replace_document(identifier, doc)
def find(self, wordlist):
'''look up all the words in the wordlist.