Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin/sample-client.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sample-client.py')
-rwxr-xr-xbin/sample-client.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/bin/sample-client.py b/bin/sample-client.py
index 9fc3f10..1a2475d 100755
--- a/bin/sample-client.py
+++ b/bin/sample-client.py
@@ -12,22 +12,29 @@ def main():
uid = datastore.create(dict(title="from dbus", author="Benjamin"), os.path.abspath('tests/test.pdf'))
print "created uid", uid
+
+ #for u in datastore.find()[0]:
+ # datastore.delete(u['uid'])
+ #return
+ # let the async indexer run
time.sleep(1.2)
-
+ #import pdb;pdb.set_trace()
print "find", datastore.find(dict(author="Benjamin", title="from"))
res, count = datastore.find(dict(fulltext="peek"))
if not res:
print "unable to index content"
- return
- item = res[0]
- print "bcsaller", item['uid']
+ #return
+ print "bcsaller", [item['uid'] for item in res]
print "huh?", datastore.find(dict(fulltext="kfdshaksjd"))
# try the other mimetypes
- datastore.update(uid, dict(title="updated title"), os.path.abspath('tests/test.doc'))
- datastore.update(uid, dict(title="another updated title"), os.path.abspath('tests/test.odt'))
+ datastore.update(uid, dict(title="updated title", mime_type="application/msword"), os.path.abspath('tests/test.doc'))
+ print datastore.find(dict(fulltext="inside"))
+ datastore.update(uid, dict(title="another updated title", mime_type="application/vnd.oasis.opendocument.text"), os.path.abspath('tests/test.odt'))
+ print datastore.find(dict(fulltext="amazed"))
datastore.get_properties(uid)
+
datastore.delete(uid)
if __name__ == '__main__':