fix glitch caused by udi prefix change
This commit is contained in:
parent
46a7f1692c
commit
343e4f4f17
4 changed files with 13 additions and 10 deletions
|
@ -18,10 +18,10 @@
|
|||
#include "autoconfig.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
//#include <set>
|
||||
#include <tr1/unordered_set>
|
||||
using std::tr1::unordered_set;
|
||||
|
||||
|
@ -102,11 +102,7 @@ public:
|
|||
for (i = 0; i < sizeof(uniignblocks) / sizeof(int); i++) {
|
||||
vignblocks.push_back(uniignblocks[i]);
|
||||
}
|
||||
if (vignblocks.size() % 2) {
|
||||
LOGFATAL(("Fatal internal error: unicode ign blocks array "
|
||||
"size not even\n"));
|
||||
abort();
|
||||
}
|
||||
assert((vignblocks.size() % 2) == 0);
|
||||
|
||||
for (i = 0; i < sizeof(avsbwht) / sizeof(int); i++) {
|
||||
visiblewhite.insert(avsbwht[i]);
|
||||
|
|
|
@ -76,6 +76,11 @@ static const string xapday_prefix = "D";
|
|||
static const string xapmonth_prefix = "M";
|
||||
static const string xapyear_prefix = "Y";
|
||||
const string pathelt_prefix = "XP";
|
||||
const string udi_prefix("Q");
|
||||
const string parent_prefix("F");
|
||||
|
||||
// Special terms to mark begin/end of field (for anchored searches), and
|
||||
// page breaks
|
||||
#ifdef RCL_INDEX_STRIPCHARS
|
||||
const string start_of_field_term = "XXST";
|
||||
const string end_of_field_term = "XXND";
|
||||
|
@ -104,7 +109,7 @@ static const string cstr_syntAbs("?!#@");
|
|||
// "Q" + external udi
|
||||
static inline string make_uniterm(const string& udi)
|
||||
{
|
||||
string uniterm(wrap_prefix("Q"));
|
||||
string uniterm(wrap_prefix(udi_prefix));
|
||||
uniterm.append(udi);
|
||||
return uniterm;
|
||||
}
|
||||
|
@ -116,7 +121,7 @@ static inline string make_parentterm(const string& udi)
|
|||
// I prefer to be in possible conflict with omega than with
|
||||
// user-defined fields (Xxxx) that we also allow. "F" is currently
|
||||
// not used by omega (2008-07)
|
||||
string pterm(wrap_prefix("F"));
|
||||
string pterm(wrap_prefix(parent_prefix));
|
||||
pterm.append(udi);
|
||||
return pterm;
|
||||
}
|
||||
|
|
|
@ -398,6 +398,8 @@ private:
|
|||
string version_string();
|
||||
|
||||
extern const string pathelt_prefix;
|
||||
extern const string udi_prefix;
|
||||
extern const string parent_prefix;
|
||||
#ifdef RCL_INDEX_STRIPCHARS
|
||||
extern const string start_of_field_term;
|
||||
extern const string end_of_field_term;
|
||||
|
|
|
@ -454,11 +454,11 @@ bool Query::getDoc(int xapi, Doc &doc)
|
|||
m_reason.erase();
|
||||
Chrono chron;
|
||||
Xapian::TermIterator it = xdoc.termlist_begin();
|
||||
it.skip_to("Q");
|
||||
it.skip_to(wrap_prefix(udi_prefix));
|
||||
if (it != xdoc.termlist_end()) {
|
||||
udi = *it;
|
||||
if (!udi.empty())
|
||||
udi = udi.substr(1);
|
||||
udi = udi.substr(wrap_prefix(udi_prefix).size());
|
||||
}
|
||||
LOGDEB2(("Query::getDoc: %d ms for udi [%s], collapse count %d\n",
|
||||
chron.millis(), udi.c_str(), collapsecount));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue