[Zope3-checkins]
SVN: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/
Moved IExtendedQuerying to text interfaces.py
Jim Fulton
jim at zope.com
Tue Dec 7 13:23:59 EST 2004
Log message for revision 28579:
Moved IExtendedQuerying to text interfaces.py
Changed:
U Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py
U Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/baseindex.py
U Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/interfaces.py
-=-
Modified: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py
===================================================================
--- Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py 2004-12-07 18:17:30 UTC (rev 28578)
+++ Zope3/branches/jim-index-restructure-2004-12/src/zope/index/interfaces.py 2004-12-07 18:23:58 UTC (rev 28579)
@@ -111,45 +111,6 @@
"""Return the number of words currently indexed."""
-class IExtendedQuerying(Interface):
- """An index that supports advanced search setups."""
-
- def search(term):
- """Execute a search on a single term given as a string.
-
- Return an IIBTree mapping docid to score, or None if all docs
- match due to the lexicon returning no wids for the term (e.g.,
- if the term is entirely composed of stopwords).
- """
-
- def search_phrase(phrase):
- """Execute a search on a phrase given as a string.
-
- Return an IIBtree mapping docid to score.
- """
-
- def search_glob(pattern):
- """Execute a pattern search.
-
- The pattern represents a set of words by using * and ?. For
- example, "foo*" represents the set of all words in the lexicon
- starting with "foo".
-
- Return an IIBTree mapping docid to score.
- """
-
- def query_weight(terms):
- """Return the weight for a set of query terms.
-
- 'terms' is a sequence of all terms included in the query,
- although not terms with a not. If a term appears more than
- once in a query, it should appear more than once in terms.
-
- Nothing is defined about what "weight" means, beyond that the
- result is an upper bound on document scores returned for the
- query.
- """
-
class IKeywordQuerying(Interface):
"""Query over a set of keywords, seperated by white space."""
Modified: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/baseindex.py
===================================================================
--- Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/baseindex.py 2004-12-07 18:17:30 UTC (rev 28578)
+++ Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/baseindex.py 2004-12-07 18:23:58 UTC (rev 28579)
@@ -25,7 +25,9 @@
from BTrees.IIBTree import intersection, difference
from BTrees import Length
-from zope.index.interfaces import IInjection, IStatistics, IExtendedQuerying
+from zope.index.interfaces import IInjection, IStatistics
+
+from zope.index.text.interfaces import IExtendedQuerying
from zope.index.text import widcode
from zope.index.text.setops import mass_weightedIntersection, \
mass_weightedUnion
Modified: Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/interfaces.py
===================================================================
--- Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/interfaces.py 2004-12-07 18:17:30 UTC (rev 28578)
+++ Zope3/branches/jim-index-restructure-2004-12/src/zope/index/text/interfaces.py 2004-12-07 18:23:58 UTC (rev 28579)
@@ -166,3 +166,43 @@
def process(text):
"""Run the splitter over the input text, returning a list of terms."""
+
+
+class IExtendedQuerying(Interface):
+ """An index that supports advanced search setups."""
+
+ def search(term):
+ """Execute a search on a single term given as a string.
+
+ Return an IIBTree mapping docid to score, or None if all docs
+ match due to the lexicon returning no wids for the term (e.g.,
+ if the term is entirely composed of stopwords).
+ """
+
+ def search_phrase(phrase):
+ """Execute a search on a phrase given as a string.
+
+ Return an IIBtree mapping docid to score.
+ """
+
+ def search_glob(pattern):
+ """Execute a pattern search.
+
+ The pattern represents a set of words by using * and ?. For
+ example, "foo*" represents the set of all words in the lexicon
+ starting with "foo".
+
+ Return an IIBTree mapping docid to score.
+ """
+
+ def query_weight(terms):
+ """Return the weight for a set of query terms.
+
+ 'terms' is a sequence of all terms included in the query,
+ although not terms with a not. If a term appears more than
+ once in a query, it should appear more than once in terms.
+
+ Nothing is defined about what "weight" means, beyond that the
+ result is an upper bound on document scores returned for the
+ query.
+ """
More information about the Zope3-Checkins
mailing list