|
a/src/common/rclconfig.cpp |
|
b/src/common/rclconfig.cpp |
|
... |
|
... |
112 |
m_fields = 0;
|
112 |
m_fields = 0;
|
113 |
m_ptrans = 0;
|
113 |
m_ptrans = 0;
|
114 |
m_stopsuffixes = 0;
|
114 |
m_stopsuffixes = 0;
|
115 |
m_maxsufflen = 0;
|
115 |
m_maxsufflen = 0;
|
116 |
|
116 |
|
|
|
117 |
m_oldstpsuffstate.init(0);
|
117 |
m_stpsuffstate.init(0);
|
118 |
m_stpsuffstate.init(0);
|
118 |
m_skpnstate.init(0);
|
119 |
m_skpnstate.init(0);
|
119 |
m_rmtstate.init(0);
|
120 |
m_rmtstate.init(0);
|
120 |
m_xmtstate.init(0);
|
121 |
m_xmtstate.init(0);
|
121 |
m_mdrstate.init(0);
|
122 |
m_mdrstate.init(0);
|
|
... |
|
... |
128 |
path_catslash(specifiedconf);
|
129 |
path_catslash(specifiedconf);
|
129 |
return !defaultconf.compare(specifiedconf);
|
130 |
return !defaultconf.compare(specifiedconf);
|
130 |
}
|
131 |
}
|
131 |
|
132 |
|
132 |
RclConfig::RclConfig(const string *argcnf)
|
133 |
RclConfig::RclConfig(const string *argcnf)
|
133 |
: m_stpsuffstate(this, "recoll_noindex"),
|
134 |
: m_oldstpsuffstate(this, "recoll_noindex"),
|
|
|
135 |
m_stpsuffstate(this, "noContentSuffixes"),
|
134 |
m_skpnstate(this, "skippedNames"),
|
136 |
m_skpnstate(this, "skippedNames"),
|
135 |
m_rmtstate(this, "indexedmimetypes"),
|
137 |
m_rmtstate(this, "indexedmimetypes"),
|
136 |
m_xmtstate(this, "excludedmimetypes"),
|
138 |
m_xmtstate(this, "excludedmimetypes"),
|
137 |
m_mdrstate(this, "metadatacmds")
|
139 |
m_mdrstate(this, "metadatacmds")
|
138 |
{
|
140 |
{
|
|
... |
|
... |
280 |
m_ptrans = new ConfSimple(path_cat(m_confdir, "ptrans").c_str());
|
282 |
m_ptrans = new ConfSimple(path_cat(m_confdir, "ptrans").c_str());
|
281 |
|
283 |
|
282 |
m_ok = true;
|
284 |
m_ok = true;
|
283 |
setKeyDir(cstr_null);
|
285 |
setKeyDir(cstr_null);
|
284 |
|
286 |
|
285 |
m_stpsuffstate.init(mimemap);
|
287 |
m_oldstpsuffstate.init(mimemap);
|
|
|
288 |
m_stpsuffstate.init(m_conf);
|
286 |
m_skpnstate.init(m_conf);
|
289 |
m_skpnstate.init(m_conf);
|
287 |
m_rmtstate.init(m_conf);
|
290 |
m_rmtstate.init(m_conf);
|
288 |
m_xmtstate.init(m_conf);
|
291 |
m_xmtstate.init(m_conf);
|
289 |
m_mdrstate.init(m_conf);
|
292 |
m_mdrstate.init(m_conf);
|
290 |
|
293 |
|
|
... |
|
... |
603 |
#define STOPSUFFIXES ((SuffixStore *)m_stopsuffixes)
|
606 |
#define STOPSUFFIXES ((SuffixStore *)m_stopsuffixes)
|
604 |
|
607 |
|
605 |
bool RclConfig::inStopSuffixes(const string& fni)
|
608 |
bool RclConfig::inStopSuffixes(const string& fni)
|
606 |
{
|
609 |
{
|
607 |
LOGDEB2(("RclConfig::inStopSuffixes(%s)\n", fni.c_str()));
|
610 |
LOGDEB2(("RclConfig::inStopSuffixes(%s)\n", fni.c_str()));
|
608 |
// Beware: needrecompute() needs to be called always. 2nd test stays back.
|
611 |
// Beware: both needrecompute() need to be called always hence the
|
|
|
612 |
// bizarre way we do things
|
|
|
613 |
bool needrecompute = m_stpsuffstate.needrecompute();
|
|
|
614 |
needrecompute = needrecompute || m_oldstpsuffstate.needrecompute();
|
609 |
if (m_stpsuffstate.needrecompute() || m_stopsuffixes == 0) {
|
615 |
if (needrecompute || m_stopsuffixes == 0) {
|
610 |
// Need to initialize the suffixes
|
616 |
// Need to initialize the suffixes
|
611 |
delete STOPSUFFIXES;
|
617 |
delete STOPSUFFIXES;
|
612 |
if ((m_stopsuffixes = new SuffixStore) == 0) {
|
618 |
if ((m_stopsuffixes = new SuffixStore) == 0) {
|
613 |
LOGERR(("RclConfig::inStopSuffixes: out of memory\n"));
|
619 |
LOGERR(("RclConfig::inStopSuffixes: out of memory\n"));
|
614 |
return false;
|
620 |
return false;
|
615 |
}
|
621 |
}
|
616 |
list<string> stoplist;
|
622 |
vector<string> stoplist;
|
617 |
stringToStrings(m_stpsuffstate.savedvalue, stoplist);
|
623 |
stringToStrings(m_stpsuffstate.savedvalue, stoplist);
|
|
|
624 |
vector<string> ostoplist;
|
|
|
625 |
stringToStrings(m_oldstpsuffstate.savedvalue, ostoplist);
|
|
|
626 |
stoplist.resize(stoplist.size() + ostoplist.size());
|
|
|
627 |
stoplist.insert(stoplist.end(), ostoplist.begin(), ostoplist.end());
|
618 |
for (list<string>::const_iterator it = stoplist.begin();
|
628 |
for (vector<string>::const_iterator it = stoplist.begin();
|
619 |
it != stoplist.end(); it++) {
|
629 |
it != stoplist.end(); it++) {
|
620 |
STOPSUFFIXES->insert(SfString(stringtolower(*it)));
|
630 |
STOPSUFFIXES->insert(SfString(stringtolower(*it)));
|
621 |
if (m_maxsufflen < it->length())
|
631 |
if (m_maxsufflen < it->length())
|
622 |
m_maxsufflen = it->length();
|
632 |
m_maxsufflen = it->length();
|
623 |
}
|
633 |
}
|
|
... |
|
... |
1459 |
if (r.m_stopsuffixes)
|
1469 |
if (r.m_stopsuffixes)
|
1460 |
m_stopsuffixes = new SuffixStore(*((SuffixStore*)r.m_stopsuffixes));
|
1470 |
m_stopsuffixes = new SuffixStore(*((SuffixStore*)r.m_stopsuffixes));
|
1461 |
m_maxsufflen = r.m_maxsufflen;
|
1471 |
m_maxsufflen = r.m_maxsufflen;
|
1462 |
m_defcharset = r.m_defcharset;
|
1472 |
m_defcharset = r.m_defcharset;
|
1463 |
|
1473 |
|
1464 |
m_stpsuffstate.init(mimemap);
|
1474 |
m_oldstpsuffstate.init(mimemap);
|
|
|
1475 |
m_stpsuffstate.init(m_conf);
|
1465 |
m_skpnstate.init(m_conf);
|
1476 |
m_skpnstate.init(m_conf);
|
1466 |
m_rmtstate.init(m_conf);
|
1477 |
m_rmtstate.init(m_conf);
|
1467 |
m_xmtstate.init(m_conf);
|
1478 |
m_xmtstate.init(m_conf);
|
1468 |
m_mdrstate.init(m_conf);
|
1479 |
m_mdrstate.init(m_conf);
|
1469 |
|
1480 |
|