Contains the main functions/classes for creating, maintaining, and using an index.
Convenience function to create an index in a directory. Takes care of creating a FileStorage object for you.
Parameters: |
|
---|---|
Returns: |
Convenience function for opening an index in a directory. Takes care of creating a FileStorage object for you. dirname is the filename of the directory in containing the index. indexname is the name of the index to create; you only need to specify this if you have multiple indexes within the same storage object.
Parameters: |
|
---|
Returns True if dirname contains a Whoosh index.
Parameters: |
|
---|
Deprecated; use storage.index_exists().
Parameters: |
|
---|
Returns a tuple of (release_version, format_version), where release_version is the release version number of the Whoosh code that created the index – e.g. (0, 1, 24) – and format_version is the version number of the on-disk format used for the index – e.g. -102.
You should avoid attaching significance to the second number (the index version). This is simply a version number for the TOC file and probably should not have been exposed in a public interface. The best way to check if the current version of Whoosh can open an index is to actually try to open it and see if it raises a whoosh.index.IndexVersionError exception.
Note that the release and format version are available as attributes on the Index object in Index.release and Index.version.
Parameters: |
|
---|---|
Returns: | ((major_ver, minor_ver, build_ver), format_ver) |
Returns a tuple of (release_version, format_version), where release_version is the release version number of the Whoosh code that created the index – e.g. (0, 1, 24) – and format_version is the version number of the on-disk format used for the index – e.g. -102.
You should avoid attaching significance to the second number (the index version). This is simply a version number for the TOC file and probably should not have been exposed in a public interface. The best way to check if the current version of Whoosh can open an index is to actually try to open it and see if it raises a whoosh.index.IndexVersionError exception.
Note that the release and format version are available as attributes on the Index object in Index.release and Index.version.
Parameters: |
|
---|---|
Returns: | ((major_ver, minor_ver, build_ver), format_ver) |
Represents an indexed collection of documents.
Adds a field to the index’s schema.
Parameters: |
|
---|
Returns an IndexReader object for this index.
Parameter: | reuse – an existing reader. Some implementations may recycle resources from this existing reader to create the new reader. Note that any resources in the “recycled” reader that are not used by the new reader will be CLOSED, so you CANNOT use it afterward. |
---|---|
Return type: | whoosh.reading.IndexReader |
Returns a new Index object representing the latest generation of this index (if this object is the latest generation, or the backend doesn’t support versioning, returns self).
Returns: | Index |
---|
Returns a Searcher object for this index. Keyword arguments are passed to the Searcher object’s constructor.
Return type: | whoosh.searching.Searcher |
---|
Returns an IndexWriter object for this index.
Return type: | whoosh.writing.IndexWriter |
---|