|
Revision 9256, 4.4 kB
(checked in by olly, 16 months ago)
|
|
common/msvc_posix_wrapper.cc,common/msvc_posix_wrapper.h: Add
msvc_posix_rename() which can rename a file on top of another file.
common/stringutils.h: Add common_prefix_length() function.
backends/flint/: Clean up FlintWritableDatabase? - it now just
inherits from FlintDatabase? which allows several virtual methods
which just forwarded to FlintDatabase? to be dropped. Also, we
now no longer need to pass FlintTable objects to other classes
- they can just find the tables they want via the database pointer.
The never-used "store_termfreqs" flag has been dropped from the
termlist table entries - existing 1.0.x flint databases will be
automatically upgraded to the new version. Opening a database
now calls stat() less, so should be slightly more efficient.
And TermIterator::positionlist_count() now works for the flint
backend.
tests/Makefile.am,tests/api_db.cc,tests/testdata/flint-1.0.2/: New
test flintbackwardcompat2 which tests that we can open a flint
database from 1.0.2.
tests/api_wrdb.cc: New test adddoc4 which checks that termlists
handle an initial term of any valid length correctly.
tests/testdata/flint-1.0.1/postlist.DB: Mark as a binary file in
SVN.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | #ifndef XAPIAN_INCLUDED_FLINT_TERMLIST_H |
|---|
| 22 | #define XAPIAN_INCLUDED_FLINT_TERMLIST_H |
|---|
| 23 | |
|---|
| 24 | #include <string> |
|---|
| 25 | |
|---|
| 26 | #include <xapian/base.h> |
|---|
| 27 | #include <xapian/positioniterator.h> |
|---|
| 28 | #include <xapian/types.h> |
|---|
| 29 | |
|---|
| 30 | namespace Xapian { |
|---|
| 31 | namespace Internal { |
|---|
| 32 | class ExpandStats; |
|---|
| 33 | } |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | #include "flint_database.h" |
|---|
| 37 | #include "termlist.h" |
|---|
| 38 | #include "flint_table.h" |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | class FlintTermList : public TermList { |
|---|
| 42 | |
|---|
| 43 | void operator=(const FlintTermList &); |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | FlintTermList(const FlintTermList &); |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | Xapian::Internal::RefCntPtr<const FlintDatabase> db; |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | Xapian::docid did; |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | flint_doclen_t doclen; |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | Xapian::termcount termlist_size; |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | std::string data; |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | const char *pos; |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | const char *end; |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | std::string current_term; |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | Xapian::termcount current_wdf; |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | mutable Xapian::doccount current_termfreq; |
|---|
| 84 | |
|---|
| 85 | public: |
|---|
| 86 | |
|---|
| 87 | FlintTermList(Xapian::Internal::RefCntPtr<const FlintDatabase> db_, |
|---|
| 88 | Xapian::docid did_); |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | flint_doclen_t get_doclength() const; |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | Xapian::termcount get_approx_size() const; |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | void accumulate_stats(Xapian::Internal::ExpandStats & stats) const; |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | std::string get_termname() const; |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | Xapian::termcount get_wdf() const; |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | Xapian::doccount get_termfreq() const; |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | TermList * next(); |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | bool at_end() const; |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | Xapian::termcount positionlist_count() const; |
|---|
| 135 | |
|---|
| 136 | |
|---|
| 137 | Xapian::PositionIterator positionlist_begin() const; |
|---|
| 138 | }; |
|---|
| 139 | |
|---|
| 140 | #endif // XAPIAN_INCLUDED_FLINT_TERMLIST_H |
|---|