Commits

while0pass  committed a132da7

Mark up some inline litteral text.

  • Participants
  • Parent commits fbc55da

Comments (0)

Files changed (1)

File docs/source/indexing.rst

 leave out a field from a document.
 
 Indexed fields must be passed a unicode value. Fields that are stored but not
-indexed (i.e. the STORED field type) can be passed any pickle-able object.
+indexed (i.e. the ``STORED`` field type) can be passed any pickle-able object.
 
 Whoosh will happily allow you to add documents with identical values, which can
 be useful or annoying depending on what you're using the library for::
     writer.add_document(path=u"/a", title=u"A", content=u"Deja vu!")
 
 This adds two documents to the index with identical path and title fields. See
-"updating documents" below for information on the update_document method, which
+"updating documents" below for information on the ``update_document`` method, which
 uses "unique" fields to replace old documents instead of appending.
 
 
 
 If you have a field that is both indexed and stored, you can index a unicode
 value but store a different object if necessary (it's usually not, but sometimes
-this is really useful) using a "special" keyword argument _stored_<fieldname>.
+this is really useful) using a "special" keyword argument ``_stored_<fieldname>``.
 The normal value will be analyzed and indexed, but the "stored" value will show
 up in the results::
 
 Keep in mind that while you have a writer open (including a writer you opened
 and is still in scope), no other thread or process can get a writer or modify
 the index. A writer also keeps several open files. So you should always remember
-to call either commit() or cancel() when you're done with a writer object.
+to call either ``commit()`` or ``cancel()`` when you're done with a writer object.
 
 
 Merging segments
 So, having a few segments is more efficient than rewriting the entire index
 every time you add some documents. But searching multiple segments does slow
 down searching somewhat, and the more segments you have, the slower it gets. So
-Whoosh has an algorithm that runs when you call commit() that looks for small
+Whoosh has an algorithm that runs when you call ``commit()`` that looks for small
 segments it can merge together to make fewer, bigger segments.
 
 To prevent Whoosh from merging segments during a commit, use the ``merge``
 
 ``is_deleted(docnum)``
 
-    Low-level method, returns True if the document with the given internal
+    Low-level method, returns ``True`` if the document with the given internal
     number is deleted.
 
 ``delete_by_term(fieldname, termtext)``
 
     Deletes any documents where the given (indexed) field contains the given
-    term. This is mostly useful for ID or KEYWORD fields.
+    term. This is mostly useful for ``ID`` or ``KEYWORD`` fields.
 
 ``delete_by_query(query)``
 
 The "unique" field(s) must be indexed.
 
 If no existing document matches the unique fields of the document you're
-updating, update_document acts just like add_document.
+updating, ``update_document`` acts just like ``add_document``.
 
-"Unique" fields and update_document are simply convenient shortcuts for deleting
+"Unique" fields and ``update_document`` are simply convenient shortcuts for deleting
 and adding. Whoosh has no inherent concept of a unique identifier, and in no way
-enforces uniqueness when you use add_document.
+enforces uniqueness when you use ``add_document``.
 
 
 Incremental indexing
 
 
     def add_doc(writer, path):
-      fileobj=open(path, "rb")
-      content=fileobj.read()
+      fileobj = open(path, "rb")
+      content = fileobj.read()
       fileobj.close()
       writer.add_document(path=path, content=content)
 
       return Schema(path=ID(unique=True, stored=True), time=STORED, content=TEXT)
 
     def add_doc(writer, path):
-      fileobj=open(path, "rb")
-      content=fileobj.read()
+      fileobj = open(path, "rb")
+      content = fileobj.read()
       fileobj.close()
       modtime = os.path.getmtime(path)
       writer.add_document(path=path, content=content, time=modtime)
 
           writer.commit()
 
-The incremental_index function:
+The ``incremental_index`` function:
 
 * Loops through all the paths that are currently indexed.