diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index a1090610..6a8ff52e 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.54 2006-01-26 12:28:50 dockes Exp $ (C) 2004 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.55 2006-01-27 13:34:42 dockes Exp $ (C) 2004 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -52,6 +52,18 @@ using namespace std; #define MIN(A,B) (A& terms) { Chrono chron; @@ -1376,15 +1386,15 @@ string Native::makeAbstract(Xapian::docid docid, const list& terms) unsigned int ipos = *pos; LOGDEB1(("Abstract: [%s] at %d\n", qit->c_str(), ipos)); // Possibly extend the array. Do it in big chunks - if (ipos + EXTRACT_WIDTH >= buf.size()) { - buf.resize(ipos + EXTRACT_WIDTH + 1000); + if (ipos + MA_EXTRACT_WIDTH >= buf.size()) { + buf.resize(ipos + MA_EXTRACT_WIDTH + 1000); } buf[ipos] = *qit; // Remember the term position qtermposs.push_back(ipos); // Add adjacent slots to the set to populate at next step - for (unsigned int ii = MAX(0, ipos-EXTRACT_WIDTH); - ii <= MIN(ipos+EXTRACT_WIDTH, buf.size()-1); ii++) { + for (unsigned int ii = MAX(0, ipos-MA_EXTRACT_WIDTH); + ii <= MIN(ipos+MA_EXTRACT_WIDTH, buf.size()-1); ii++) { chunkposs.insert(ii); } // Limit the number of occurences we keep for each @@ -1437,21 +1447,21 @@ string Native::makeAbstract(Xapian::docid docid, const list& terms) for (vector::const_iterator it = qtermposs.begin(); it != qtermposs.end(); it++) { unsigned int ipos = *it; - unsigned int start = MAX(0, ipos-EXTRACT_WIDTH); - unsigned int end = MIN(ipos+EXTRACT_WIDTH, buf.size()-1); + unsigned int start = MAX(0, ipos-MA_EXTRACT_WIDTH); + unsigned int end = MIN(ipos+MA_EXTRACT_WIDTH, buf.size()-1); string chunk; for (unsigned int ii = start; ii <= end; ii++) { if (!buf[ii].empty()) { chunk += buf[ii] + " "; abslen += buf[ii].length(); } - if (abslen > 300) + if (abslen > MA_ABSTRACT_SIZE) break; } if (end != buf.size()-1) chunk += "... "; mabs[ipos] = chunk; - if (abslen > 300) + if (abslen > MA_ABSTRACT_SIZE) break; }