Changeset View
Changeset View
Standalone View
Standalone View
src/engine/transaction.cpp
Show All 14 Lines | |||||
15 | * You should have received a copy of the GNU Lesser General Public | 15 | * You should have received a copy of the GNU Lesser General Public | ||
16 | * License along with this library; if not, write to the Free Software | 16 | * License along with this library; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | * | 18 | * | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "transaction.h" | 21 | #include "transaction.h" | ||
22 | #include "postingdb.h" | 22 | #include "postingdb.h" | ||
23 | #include "fuzzydb.h" | ||||
23 | #include "documentdb.h" | 24 | #include "documentdb.h" | ||
24 | #include "documenturldb.h" | 25 | #include "documenturldb.h" | ||
25 | #include "documentiddb.h" | 26 | #include "documentiddb.h" | ||
26 | #include "positiondb.h" | 27 | #include "positiondb.h" | ||
27 | #include "documentdatadb.h" | 28 | #include "documentdatadb.h" | ||
28 | #include "mtimedb.h" | 29 | #include "mtimedb.h" | ||
29 | 30 | | |||
30 | #include "document.h" | 31 | #include "document.h" | ||
▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Line(s) | |||||
290 | // | 291 | // | ||
291 | // Queries | 292 | // Queries | ||
292 | // | 293 | // | ||
293 | 294 | | |||
294 | PostingIterator* Transaction::postingIterator(const EngineQuery& query) const | 295 | PostingIterator* Transaction::postingIterator(const EngineQuery& query) const | ||
295 | { | 296 | { | ||
296 | PostingDB postingDb(m_dbis.postingDbi, m_txn); | 297 | PostingDB postingDb(m_dbis.postingDbi, m_txn); | ||
297 | PositionDB positionDb(m_dbis.positionDBi, m_txn); | 298 | PositionDB positionDb(m_dbis.positionDBi, m_txn); | ||
299 | FuzzyDB fuzzy_db(m_dbis.fuzzyDbi, m_txn); | ||||
298 | 300 | | |||
299 | if (query.leaf()) { | 301 | if (query.leaf()) { | ||
302 | // TODO: support fuzzy matching through config | ||||
303 | qDebug() << "returning fuzzy match on" << query.term(); | ||||
304 | return fuzzy_db.iter(query.term()); | ||||
300 | if (query.op() == EngineQuery::Equal) { | 305 | if (query.op() == EngineQuery::Equal) { | ||
301 | return postingDb.iter(query.term()); | 306 | return postingDb.iter(query.term()); | ||
302 | } else if (query.op() == EngineQuery::StartsWith) { | 307 | } else if (query.op() == EngineQuery::StartsWith) { | ||
303 | return postingDb.prefixIter(query.term()); | 308 | return postingDb.prefixIter(query.term()); | ||
304 | } else { | 309 | } else { | ||
305 | Q_ASSERT(0); | 310 | Q_ASSERT(0); | ||
306 | } | 311 | } | ||
307 | } | 312 | } | ||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |