Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-16 16:05:45 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-16 16:05:45 (GMT)
commitd750a77ffeb6da5ecd61824f7a8653b0c0ba68e9 (patch)
treed69deecc37d09a32939bda90c13859e94b24874a
parent777d545f4ac03adb8f49b802e01eecb46a345593 (diff)
limit/offset -- set limit to 4096 per backend for now
-rw-r--r--src/olpc/datastore/backingstore.py5
-rw-r--r--src/olpc/datastore/datastore.py4
-rw-r--r--src/olpc/datastore/xapianindex.py3
3 files changed, 6 insertions, 6 deletions
diff --git a/src/olpc/datastore/backingstore.py b/src/olpc/datastore/backingstore.py
index fd7ca2f..a7a51ca 100644
--- a/src/olpc/datastore/backingstore.py
+++ b/src/olpc/datastore/backingstore.py
@@ -378,10 +378,7 @@ class FileBackingStore(BackingStore):
def find(self, query):
- limit = query.pop('limit', 50)
- offset = query.pop('offset', 0)
-
- return self.indexmanager.search(query, offset, limit)
+ return self.indexmanager.search(query)
def stop(self):
self.indexmanager.stop()
diff --git a/src/olpc/datastore/datastore.py b/src/olpc/datastore/datastore.py
index 9880f43..34eb23c 100644
--- a/src/olpc/datastore/datastore.py
+++ b/src/olpc/datastore/datastore.py
@@ -27,6 +27,8 @@ DS_OBJECT_PATH = "/org/laptop/sugar/DataStore"
logger = logging.getLogger(DS_LOG_CHANNEL)
+DEFAULT_LIMIT = 65536
+
class DataStore(dbus.service.Object):
def __init__(self, **options):
@@ -259,7 +261,7 @@ class DataStore(dbus.service.Object):
order_by = kwargs.pop('order_by', [])
# XXX: this is a workaround, deal properly with n backends
- limit = kwargs.pop('limit', 50)
+ limit = kwargs.pop('limit', DEFAULT_LIMIT)
offset = kwargs.pop('offset', 0)
# distribute the search to all the mountpoints unless a
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py
index c465b41..7effc4c 100644
--- a/src/olpc/datastore/xapianindex.py
+++ b/src/olpc/datastore/xapianindex.py
@@ -16,6 +16,7 @@ __license__ = 'The GNU Public License V2+'
from Queue import Queue, Empty
import logging
import re
+import sys
import threading
import warnings
@@ -308,7 +309,7 @@ class IndexManager(object):
#
# Search
- def search(self, query, start_index=0, end_index=50):
+ def search(self, query, start_index=0, end_index=4096):
"""search the xapian store.
query is a string defining the serach in standard web search syntax.