From 5d022e524e1449f290c4f94331babad7193732c7 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sat, 26 Apr 2008 17:00:28 +0000 Subject: [PATCH] added catalog package with a simple variation of hurry.query and a keyword index git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2555 fd906abe-77d9-0310-91a1-e0d9ade77398 --- catalog/README.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/catalog/README.txt b/catalog/README.txt index f0dd671..6273fb7 100644 --- a/catalog/README.txt +++ b/catalog/README.txt @@ -71,7 +71,7 @@ Now let's create some objects so that they'll be cataloged. ... Content(3, 'X', 'c'), ... Content(4, 'a', 'b', 'e'), ... Content(5, 'X', 'b', 'e', k1=('zope', 'plone')), - ... Content(6, 'Y', 'Z', t1='some interesting text')] + ... Content(6, 'Y', 'Z', t1='some very interesting text')] And catalog them now. @@ -189,7 +189,14 @@ Text Index Queries >>> t1 = ('', 't1') >>> displayQueryWithScores(Text(t1, 'interesting')) [(6, 0.149...)] - >>> displayQueryWithScores(Text(t1, 'interesting') & Eq(f1, 'Y') + >>> displayQueryWithScores(Text(t1, 'interesting') & Eq(f1, 'Y')) + [(6, 1.149...)] + >>> displayQueryWithScores(Text(t1, 'interesting') | Eq(f1, 'a')) + [(1, 1.0), (2, 1.0), (4, 1.0), (6, 0.149...)] + >>> displayQueryWithScores(Text(t1, 'interesting') | Text(t1, 'text')) + [(6, 0.298...)] + >>> displayQueryWithScores(Text(t1, 'interesting') & Text(t1, 'text')) + [(6, 0.298...)] Keyword Index Queries