Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-04 20:58:54 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-04 20:58:54 (GMT)
commit649ec3d6f8e566d185eea91b22ce5a36b3e93dc1 (patch)
tree179f3fd511d72e2a1600170a207454a6d2eb5e00 /bin
parent3663a1e945a2ab03d731fe183535a04b6261196e (diff)
fix 1882
patch 1889
Diffstat (limited to 'bin')
-rwxr-xr-xbin/index-service17
-rwxr-xr-xbin/sample-client.py2
2 files changed, 16 insertions, 3 deletions
diff --git a/bin/index-service b/bin/index-service
index 6a7fc2d..4529913 100755
--- a/bin/index-service
+++ b/bin/index-service
@@ -75,6 +75,15 @@ class IndexService(Application):
self.eventloop.run()
+ def get_textprops(self, uid):
+ # text properties also get full text indexing
+ # currently this is still searched with the 'fulltext'
+ # parameter of find()
+ textprops = {}
+ for p in self.ds.get_properties(uid, type='text'):
+ textprops[p.key] = p.value and p.value or ''
+ return textprops
+
def created(self, uid):
"""An object was created on the bus and we want to index it"""
# because the file isn't encoded anywhere accessible in the
@@ -84,7 +93,8 @@ class IndexService(Application):
r = None
if filename:
mime_type = self.ds.get_properties(uid).get('mime_type', None)
- r = self.fulltext.fulltext_index(uid, filename, mime_type)
+ r = self.fulltext.fulltext_index(uid, filename, mime_type,
+ **self.get_textprops(uid))
if r is True:
logger.debug("index creation of %s" % uid)
elif r is False:
@@ -102,7 +112,8 @@ class IndexService(Application):
if filename:
mime_type = self.ds.get_properties(uid).get('mime_type', None)
print uid, filename, mime_type
- r = self.fulltext.fulltext_index(uid, filename, mime_type)
+ r = self.fulltext.fulltext_index(uid, filename, mime_type,
+ **self.get_textprops(uid))
if r is True:
logger.debug("index update of %s" % uid)
elif r is False:
@@ -139,7 +150,7 @@ if __name__ == "__main__":
signal.signal(signal.SIGTERM, handle_shutdown)
idx = IndexService()
- ##idx()
+ #idx()
# w/o ore.main
import gobject
diff --git a/bin/sample-client.py b/bin/sample-client.py
index 1a2475d..bd609a7 100755
--- a/bin/sample-client.py
+++ b/bin/sample-client.py
@@ -35,6 +35,8 @@ def main():
print datastore.find(dict(fulltext="amazed"))
datastore.get_properties(uid)
+ print "title in fulltext", datastore.find(dict(fulltext="another"))
+
datastore.delete(uid)
if __name__ == '__main__':