1. while0pass
  2. whoosh

Commits

while0pass  committed c3e44ae

fix some typos in documentation

  • Participants
  • Parent commits 33015a2
  • Branches default

Comments (0)

Files changed (1)

File docs/source/searching.rst

View file
  • Ignore whitespace
 has lots of useful methods for getting information about the index, such as
 ``lexicon(fieldname)``.
 
->>> list(searcher.lexicon("content")) [u"document", u"index", u"whoosh]
+>>> list(searcher.lexicon("content")) [u"document", u"index", u"whoosh"]
 
 However, the most important method on the Searcher object is
 :meth:`~whoosh.searching.Searcher.search`, which takes a
 documents. You can use it to access the stored fields of each hit document, to
 display to the user.
 
->>> # Show the best hit's stored fields >>> results[0] {"title": u"Hello World
-in Python", "path": u"/a/b/c"} >>> results[0:2] [{"title": u"Hello World in
-Python", "path": u"/a/b/c"}, {"title": u"Foo", "path": u"/bar"}]
+::
+
+    >>> # Show the best hit's stored fields
+    >>> results[0] {"title": u"Hello World in Python", "path": u"/a/b/c"}
+    >>> results[0:2] [{"title": u"Hello World in Python", "path": u"/a/b/c"},
+    {"title": u"Foo", "path": u"/bar"}]
 
 By default, ``Searcher.search(myquery)`` limits the number of hits to 20, So the
 number of scored hits in the ``Results`` object may be less than the number of
 matching documents in the index.
 
->>> # How many documents in the entire index would have matched? >>>
-len(results) 27 >>> # How many scored and sorted documents in this Results
-object? >>> # This will often be less than len() if the number of hits was
-limited >>> # (the default). >>> results.scored_length() 10
+::
+
+    >>> # How many documents in the entire index would have matched?
+    >>> len(results)
+    27
+    >>> # How many scored and sorted documents in this Results object?
+    >>> # This will often be less than len() if the number of hits was limited
+    >>> # (the default).
+    >>> results.scored_length()
+    10
 
 Calling ``len(Results)`` runs a fast (unscored) version of the query again to
 figure out the total number of matching documents. This is usually very fast
 results of running the filter query
 
 You can also specify a ``mask`` keyword argument to specify a set of documents
-that are not permitted in the results::
+that are not permitted in the results.
+
+::
 
     with myindex.searcher() as s:
         qp = qparser.QueryParser("content", myindex.schema)
 but otherwise only the top N documents with the same collapse key will appear
 in the results.
 
-See :doc:`/facets` for information on facets::
+See :doc:`/facets` for information on facets.
+
+::
 
     with myindex.searcher() as s:
         # Set the facet to collapse on and the maximum number of documents per