Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gdatastore/index.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/gdatastore/index.py b/gdatastore/index.py
index 616eb81..5730f54 100644
--- a/gdatastore/index.py
+++ b/gdatastore/index.py
@@ -108,10 +108,12 @@ class TermGenerator(xapian.TermGenerator):
elif not isinstance(value, str):
value = str(value)
- # We need to add the full value (i.e. not split into words), too, so
- # we can enumerate unique values. It also simplifies setting up
- # dictionary-based queries.
- self._document.add_term(_PREFIX_FULL_VALUE + prefix + value)
+ # Hardcoded Xapian term length limit
+ if len(prefix + value) < 240:
+ # We need to add the full value (i.e. not split into words), too,
+ # so we can enumerate unique values. It also simplifies setting up
+ # dictionary-based queries.
+ self._document.add_term(_PREFIX_FULL_VALUE + prefix + value)
self.index_text(value, 1, prefix)
self.increase_termpos()