Module ImportFrom alias Import alias Import alias ImportFrom alias ImportFrom alias alias ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If NameLoad body Expr Call AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults kwarg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Raise NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults kwarg body ImportFrom alias Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str ImportFrom alias Assign NameStore Call NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr TryFinally body Assign NameStore Num For NameStore Call AttributeLoad NameLoad attr NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore Num finalbody If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Raise NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults kwarg body Expr Str Raise NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults Num body If CompareIn Str NameLoad body Return Call NameLoad SubscriptLoad NameLoad Index Str orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Assign NameStore BinOpMod Str NameLoad If CompareIn NameLoad NameLoad body Return Call NameLoad SubscriptLoad NameLoad Index NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListComp NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BoolOpAnd CompareIn NameLoad NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body With Call AttributeLoad NameLoad attr NameStore body For NameStore Call AttributeLoad NameLoad attr ListComp TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad comprehension NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad TryExcept body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults kwarg body ImportFrom alias Return Call NameLoad Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If AttributeLoad NameLoad attr body Expr Call Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr While CompareIs NameLoad NameLoad body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameStore AttributeLoad NameLoad attr body Expr Call Call NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad orelse Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Num NameLoad NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body ImportFrom alias identifier Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If BoolOpAnd Call NameLoad NameLoad Str AttributeLoad NameLoad attr body If UnaryOpNot AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Delete AttributeDel NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Num Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults kwarg body ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr If Call AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad ListLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults kwarg body ImportFrom alias Return Call NameLoad Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr With AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr With AttributeLoad NameLoad attr body If AttributeLoad NameLoad attr body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad AugAssignAdd AttributeStore NameLoad attr Num If NameLoad body If AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body With AttributeLoad NameLoad attr body Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body With AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AugAssignAdd AttributeStore NameLoad attr Num If CompareGtE AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If CompareLt NameLoad AttributeLoad NameLoad attr body Return Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad keyword NameLoad orelse Return Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad AttributeLoad NameLoad attr keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body If CompareLt NameLoad AttributeLoad NameLoad attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Return Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad AttributeLoad NameLoad attr decorator_list NameLoad decorator_list Assign NameStore NameLoad
N/A __future__ with_statement N/A threading N/A time whoosh.store LockError whoosh.util abstractmethod synchronized IndexingError N/A Exception N/A N/A N/A IndexWriter N/A object N/A N/A High-level object for writing to an index.
    
    To get a writer for a particular index, call
    :meth:`~whoosh.index.Index.writer` on the Index object.
    
    >>> writer = myindex.writer()
    
    You can use this object as a context manager. If an exception is thrown
    from within the context it calls :meth:`~IndexWriter.cancel` to clean up
    temporary files, otherwise it calls :meth:`~IndexWriter.commit` when the
    context exits.
    
    >>> with myindex.writer() as w:
    ...     w.add_document(title="First document", content="Hello there.")
    ...     w.add_document(title="Second document", content="This is easy!")
     __enter__ N/A N/A self N/A N/A N/A self N/A __exit__ N/A N/A self exc_type exc_val exc_tb N/A N/A N/A exc_type N/A N/A N/A N/A self cancel N/A N/A N/A N/A self commit N/A add_field N/A N/A self fieldname fieldtype N/A kwargs N/A N/A Adds a field to the index's schema.
        
        :param fieldname: the name of the field to add.
        :param fieldtype: an instantiated :class:`whoosh.fields.FieldType`
            object.
         N/A N/A N/A N/A self schema add fieldname fieldtype kwargs N/A remove_field N/A N/A self fieldname N/A kwargs N/A N/A Removes the named field from the index's schema. Depending on the
        backend implementation, this may or may not actually remove existing
        data for the field from the index. Optimizing the index should always
        clear out existing data for a removed field.
         N/A N/A N/A N/A self schema remove fieldname kwargs N/A reader N/A N/A self N/A kwargs N/A N/A Returns a reader for the existing index.
         N/A NotImplementedError N/A abstractmethod searcher N/A N/A self N/A kwargs N/A whoosh.searching Searcher N/A N/A Searcher N/A N/A self reader kwargs N/A delete_by_term N/A N/A self fieldname text searcher N/A None N/A N/A Deletes any documents containing "term" in the "fieldname" field.
        This is useful when you have an indexed field containing a unique ID
        (such as "pathname") for each document.
        
        :returns: the number of documents deleted.
         whoosh.query Term N/A q N/A Term fieldname text N/A N/A N/A self delete_by_query q searcher searcher N/A delete_by_query N/A N/A self q searcher N/A None N/A N/A Deletes any documents matching a query object.
        
        :returns: the number of documents deleted.
         N/A searcher N/A N/A s searcher N/A N/A s N/A N/A self searcher N/A N/A N/A count 0 N/A docnum N/A N/A s docs_for_query q N/A N/A N/A N/A N/A self is_deleted docnum N/A N/A N/A N/A self delete_document docnum N/A count 1 N/A N/A N/A searcher N/A N/A N/A N/A s close N/A count N/A delete_document N/A N/A self docnum delete N/A True N/A N/A Deletes a document by number.
         N/A NotImplementedError N/A abstractmethod add_document N/A N/A self N/A fields N/A N/A The keyword arguments map field names to the values to index/store::
        
            w = myindex.writer()
            w.add_document(path=u"/a", title=u"First doc", text=u"Hello")
            w.commit()
        
        Depending on the field type, some fields may take objects other than
        unicode strings. For example, NUMERIC fields take numbers, and DATETIME
        fields take ``datetime.datetime`` objects::
        
            from datetime import datetime, timedelta
            from whoosh import index
            from whoosh.fields import *
            
            schema = Schema(date=DATETIME, size=NUMERIC(float), content=TEXT)
            myindex = index.create_in("indexdir", schema)
            
            w = myindex.writer()
            w.add_document(date=datetime.now(), size=5.5, content=u"Hello")
            w.commit()
        
        Instead of a single object (i.e., unicode string, number, or datetime),
        you can supply a list or tuple of objects. For unicode strings, this
        bypasses the field's analyzer. For numbers and dates, this lets you add
        multiple values for the given field::
        
            date1 = datetime.now()
            date2 = datetime(2005, 12, 25)
            date3 = datetime(1999, 1, 1)
            w.add_document(date=[date1, date2, date3], size=[9.5, 10],
                           content=[u"alfa", u"bravo", u"charlie"])
        
        For fields that are both indexed and stored, you can specify an
        alternate value to store using a keyword argument in the form
        "_stored_<fieldname>". For example, if you have a field named "title"
        and you want to index the text "a b c" but store the text "e f g", use
        keyword arguments like this::
        
            writer.add_document(title=u"a b c", _stored_title=u"e f g")
        
        You can boost the weight of all terms in a certain field by specifying
        a ``_<fieldname>_boost`` keyword argument. For example, if you have a
        field named "content", you can double the weight of this document for
        searches in the "content" field like this::
        
            writer.add_document(content="a b c", _title_boost=2.0)
            
        You can boost every field at once using the ``_boost`` keyword. For
        example, to boost fields "a" and "b" by 2.0, and field "c" by 3.0::
        
            writer.add_document(a="alfa", b="bravo", c="charlie",
                                _boost=2.0, _c_boost=3.0)
        
        Note that some scoring algroithms, including Whoosh's default BM25F,
        do not work with term weights less than 1, so you should generally not
        use a boost factor less than 1.
        
        See also :meth:`Writer.update_document`.
         N/A NotImplementedError N/A abstractmethod _doc_boost N/A N/A self fields default N/A 1.0 N/A N/A N/A _boost fields N/A N/A N/A float N/A fields N/A _boost N/A N/A default N/A _field_boost N/A N/A self fields fieldname default N/A 1.0 N/A N/A boostkw N/A _%s_boost fieldname N/A N/A boostkw fields N/A N/A N/A float N/A fields N/A boostkw N/A N/A default N/A _unique_fields N/A N/A self fields N/A N/A N/A unique_fields N/A name N/A N/A name field N/A N/A N/A self schema items N/A N/A name fields N/A field unique N/A unique_fields N/A update_document N/A N/A self N/A fields N/A N/A The keyword arguments map field names to the values to index/store.
        
        This method adds a new document to the index, and automatically deletes
        any documents with the same values in any fields marked "unique" in the
        schema::
        
            schema = fields.Schema(path=fields.ID(unique=True, stored=True),
                                   content=fields.TEXT)
            myindex = index.create_in("index", schema)
        
            w = myindex.writer()
            w.add_document(path=u"/", content=u"Mary had a lamb")
            w.commit()
            
            w = myindex.writer()
            w.update_document(path=u"/", content=u"Mary had a little lamb")
            w.commit()
            
            assert myindex.doc_count() == 1
        
        It is safe to use ``update_document`` in place of ``add_document``; if
        there is no existing document to replace, it simply does an add.
        
        You cannot currently pass a list or tuple of values to a "unique"
        field.
        
        Because this method has to search for documents with the same unique
        fields and delete them before adding the new document, it is slower
        than using ``add_document``.
        
        * Marking more fields "unique" in the schema will make each
          ``update_document`` call slightly slower.
        
        * When you are updating multiple documents, it is faster to batch
          delete all changed documents and then use ``add_document`` to add
          the replacements instead of using ``update_document``.
        
        Note that this method will only replace a *committed* document;
        currently it cannot replace documents you've added to the IndexWriter
        but haven't yet committed. For example, if you do this:
        
        >>> writer.update_document(unique_id=u"1", content=u"Replace me")
        >>> writer.update_document(unique_id=u"1", content=u"Replacement")
        
        ...this will add two documents with the same value of ``unique_id``,
        instead of the second document replacing the first.
        
        See :meth:`Writer.add_document` for information on
        ``_stored_<fieldname>``, ``_<fieldname>_boost``, and ``_boost`` keyword
        arguments.
         N/A unique_fields N/A N/A self _unique_fields fields N/A unique_fields N/A N/A N/A N/A self searcher s N/A N/A docnum N/A N/A s _find_unique N/A N/A name N/A fields N/A name N/A name unique_fields N/A N/A N/A N/A self delete_document docnum N/A N/A N/A self add_document fields N/A commit N/A N/A self N/A N/A N/A Finishes writing and unlocks the index.
         N/A N/A cancel N/A N/A self N/A N/A N/A Cancels any documents/deletions added by this object
        and unlocks the index.
         N/A N/A N/A AsyncWriter N/A N/A threading Thread IndexWriter N/A N/A Convenience wrapper for a writer object that might fail due to locking
    (i.e. the ``filedb`` writer). This object will attempt once to obtain the
    underlying writer, and if it's successful, will simply pass method calls on
    to it.
    
    If this object *can't* obtain a writer immediately, it will *buffer*
    delete, add, and update method calls in memory until you call ``commit()``.
    At that point, this object will start running in a separate thread, trying
    to obtain the writer over and over, and once it obtains it, "replay" all
    the buffered method calls on it.
    
    In a typical scenario where you're adding a single or a few documents to
    the index as the result of a Web transaction, this lets you just create the
    writer, add, and commit, without having to worry about index locks,
    retries, etc.
    
    For example, to get an aynchronous writer, instead of this:
    
    >>> writer = myindex.writer()
    
    Do this:
    
    >>> from whoosh.writing import AsyncWriter
    >>> writer = AsyncWriter(myindex)
     __init__ N/A N/A self index delay writerargs N/A 0.25 None N/A N/A 
        :param index: the :class:`whoosh.index.Index` to write to.
        :param delay: the delay (in seconds) between attempts to instantiate
            the actual writer.
        :param writerargs: an optional dictionary specifying keyword arguments
            to to be passed to the index's ``writer()`` method.
         N/A N/A N/A N/A threading Thread __init__ self N/A N/A self running False N/A N/A self index index N/A N/A self writerargs N/A writerargs N/A N/A N/A self delay delay N/A N/A self events N/A N/A N/A N/A N/A self writer N/A N/A N/A self index writer N/A self writerargs N/A N/A N/A LockError N/A N/A N/A self writer None N/A reader N/A N/A self N/A N/A N/A N/A N/A N/A self index reader N/A searcher N/A N/A self N/A kwargs N/A whoosh.searching Searcher N/A N/A Searcher N/A N/A self reader fromindex N/A self index kwargs N/A _record N/A N/A self method args kwargs N/A N/A N/A N/A self writer N/A N/A N/A N/A getattr N/A self writer method args kwargs N/A N/A N/A N/A N/A self events append N/A method args kwargs N/A run N/A N/A self N/A N/A N/A N/A self running True N/A writer N/A self writer N/A N/A writer None N/A N/A N/A N/A writer N/A N/A N/A self index writer N/A self writerargs N/A N/A N/A LockError N/A N/A N/A N/A time sleep N/A self delay N/A N/A method args kwargs N/A self events N/A N/A N/A N/A getattr writer method args kwargs N/A N/A N/A writer commit N/A self commitargs N/A self commitkwargs N/A delete_document N/A N/A self N/A args kwargs N/A N/A N/A N/A self _record delete_document args kwargs N/A add_document N/A N/A self N/A args kwargs N/A N/A N/A N/A self _record add_document args kwargs N/A update_document N/A N/A self N/A args kwargs N/A N/A N/A N/A self _record update_document args kwargs N/A add_field N/A N/A self N/A args kwargs N/A N/A N/A N/A self _record add_field args kwargs N/A remove_field N/A N/A self N/A args kwargs N/A N/A N/A N/A self _record remove_field args kwargs N/A delete_by_term N/A N/A self N/A args kwargs N/A N/A N/A N/A self _record delete_by_term args kwargs N/A commit N/A N/A self N/A args kwargs N/A N/A N/A self writer N/A N/A N/A N/A N/A self writer commit args kwargs N/A N/A N/A N/A self commitargs N/A self commitkwargs N/A args kwargs N/A N/A N/A self start N/A cancel N/A N/A self N/A args kwargs N/A N/A N/A self writer N/A N/A N/A N/A N/A self writer cancel args kwargs N/A N/A BufferedWriter N/A IndexWriter N/A N/A Convenience class that acts like a writer but buffers added documents to
    a :class:`~whoosh.ramindex.RamIndex` before dumping the buffered documents
    as a batch into the actual index.
    
    In scenarios where you are continuously adding single documents very
    rapidly (for example a web application where lots of users are adding
    content simultaneously), using a BufferedWriter is *much* faster than
    opening and committing a writer for each document you add.
    
    (This class may also be useful for batches of ``update_document`` calls. In
    a normal writer, ``update_document`` calls cannot update documents you've
    added *in that writer*. With ``BufferedWriter``, this will work.)
    
    If you're adding a batches of documents at a time, you can just use a
    regular writer -- you're already committing a "batch" of documents, so you
    don't need this class.
    
    To use this class, create it from your index and *keep it open*, sharing
    it between threads.
    
    >>> from whoosh.writing import BufferedWriter
    >>> writer = BufferedWriter(myindex, period=120, limit=100)
    
    You can control how often the ``BufferedWriter`` flushes the in-memory
    index to disk using the ``period`` and ``limit`` arguments. ``period`` is
    the maximum number of seconds between commits. ``limit`` is the maximum
    number of additions to buffer between commits.
    
    You can read/search the combination of the on-disk index and the buffered
    documents in memory by calling ``BufferedWriter.reader()`` or
    ``BufferedWriter.searcher()``. This allows quasi-real-time search, where
    documents are available for searching as soon as they are buffered in
    memory, before they are committed to disk.
    
    >>> searcher = writer.searcher()
    
    .. tip::
        By using a searcher from the shared writer, multiple *threads* can
        search the buffered documents. Of course, other *processes* will only
        see the documents that have been written to disk. If you want indexed
        documents to become available to other processes as soon as possible,
        you have to use a traditional writer instead of a ``BufferedWriter``.
    
    Calling ``commit()`` on the ``BufferedWriter`` manually commits any batched
    up changes. You can continue to make changes after calling ``commit()``,
    and you can call ``commit()`` multiple times.
    
    .. note::
        This object keeps an underlying writer open and stores documents in
        memory, so you must explicitly call the :meth:`~BufferedWriter.close()`
        method on this object before it goes out of scope to release the
        write lock and make sure any uncommitted changes are saved.
     __init__ N/A N/A self index period limit writerargs commitargs tempixclass N/A 60 10 None None None N/A N/A 
        :param index: the :class:`whoosh.index.Index` to write to.
        :param period: the maximum amount of time (in seconds) between commits.
            Set this to ``0`` or ``None`` to not use a timer. Do not set this
            any lower than a few seconds.
        :param limit: the maximum number of documents to buffer before
            committing.
        :param writerargs: dictionary specifying keyword arguments to be passed
            to the index's ``writer()`` method when creating a writer.
        :param commitargs: dictionary specifying keyword arguments to be passed
            to the writer's ``commit()`` method when committing a writer.
         N/A N/A self index index N/A N/A self period period N/A N/A self limit limit N/A N/A self writerargs N/A writerargs N/A N/A N/A self commitargs N/A commitargs N/A N/A N/A self _sync_lock N/A N/A threading RLock N/A N/A self _write_lock N/A N/A threading Lock N/A N/A tempixclass None N/A whoosh.ramindex RamIndex tempixclass N/A N/A self tempixclass tempixclass N/A N/A self writer None N/A N/A self base N/A N/A N/A self index doc_count_all N/A N/A self bufferedcount 0 N/A N/A self commitcount 0 N/A N/A self ramindex N/A N/A self _create_ramindex N/A N/A self period N/A N/A N/A self timer N/A N/A threading Timer N/A self period N/A self commit N/A __del__ N/A N/A self N/A N/A N/A N/A N/A hasattr self writer N/A self writer N/A N/A N/A N/A N/A self writer is_closed N/A N/A N/A N/A N/A self writer cancel N/A N/A self writer N/A _create_ramindex N/A N/A self N/A N/A N/A N/A N/A self tempixclass N/A N/A self index schema N/A _get_writer N/A N/A self N/A N/A N/A N/A N/A self writer None N/A N/A N/A self writer N/A N/A N/A self index writer N/A self writerargs N/A N/A self schema N/A N/A self writer schema N/A N/A self base N/A N/A N/A self index doc_count_all N/A N/A self bufferedcount 0 N/A N/A self writer N/A reader N/A N/A self N/A kwargs N/A whoosh.reading MultiReader N/A writer N/A N/A self _get_writer N/A ramreader N/A self ramindex N/A N/A N/A N/A self index is_empty N/A N/A ramreader N/A N/A reader N/A N/A writer reader kwargs N/A N/A N/A reader is_atomic N/A N/A reader N/A MultiReader N/A reader ramreader N/A N/A N/A N/A reader add_reader ramreader N/A reader N/A synchronized searcher N/A N/A self N/A kwargs N/A whoosh.searching Searcher N/A N/A Searcher N/A N/A self reader fromindex N/A self index kwargs N/A close N/A N/A self N/A N/A N/A N/A N/A self commit restart False N/A commit N/A N/A self restart N/A True N/A N/A N/A self period N/A N/A N/A N/A N/A self timer cancel N/A N/A self _sync_lock N/A N/A oldramindex N/A self ramindex N/A N/A self ramindex N/A N/A self _create_ramindex N/A N/A self _write_lock N/A N/A N/A self bufferedcount N/A N/A N/A N/A N/A N/A self _get_writer add_reader N/A N/A oldramindex reader N/A N/A self writer N/A N/A N/A N/A N/A self writer commit N/A self commitargs N/A N/A self writer None N/A N/A self commitcount 1 N/A restart N/A N/A N/A self period N/A N/A N/A self timer N/A N/A threading Timer N/A self period N/A self commit N/A add_reader N/A N/A self reader N/A N/A N/A N/A self _write_lock N/A N/A N/A N/A N/A N/A self _get_writer add_reader reader N/A add_document N/A N/A self N/A fields N/A N/A N/A self _sync_lock N/A N/A N/A N/A N/A self ramindex add_document fields N/A N/A self bufferedcount 1 N/A N/A N/A self bufferedcount N/A self limit N/A N/A N/A N/A self commit N/A update_document N/A N/A self N/A fields N/A N/A N/A N/A self _get_writer N/A N/A N/A N/A super BufferedWriter self update_document fields N/A synchronized delete_document N/A N/A self docnum delete N/A True N/A N/A N/A docnum N/A self base N/A N/A N/A N/A N/A N/A self _get_writer delete_document docnum delete delete N/A N/A N/A N/A N/A self ramindex delete_document N/A docnum N/A self base delete delete N/A synchronized is_deleted N/A N/A self docnum N/A N/A N/A N/A docnum N/A self base N/A N/A N/A N/A N/A self writer is_deleted docnum N/A N/A N/A N/A N/A self ramindex is_deleted N/A docnum N/A self base N/A synchronized N/A N/A BatchWriter BufferedWriter