Switch to unified view

a/src/rcldb/searchdata.cpp b/src/rcldb/searchdata.cpp
...
...
515
{
515
{
516
    string a;
516
    string a;
517
    for (vector<string>::const_iterator it = l.begin(); it != l.end(); it++) {
517
    for (vector<string>::const_iterator it = l.begin(); it != l.end(); it++) {
518
        a = a + *it + " ";
518
        a = a + *it + " ";
519
    }
519
    }
520
    LOGDEB(("%s: %s\n", what.c_str(), a.c_str()));
520
    LOGDEB0(("%s: %s\n", what.c_str(), a.c_str()));
521
}
521
}
522
#endif
522
#endif
523
523
524
/** Expand term into term list, using appropriate mode: stem, wildcards, 
524
/** Expand term into term list, using appropriate mode: stem, wildcards, 
525
 *  diacritics... 
525
 *  diacritics... 
...
...
1054
    Xapian::Query *qp = (Xapian::Query *)p;
1054
    Xapian::Query *qp = (Xapian::Query *)p;
1055
    *qp = Xapian::Query();
1055
    *qp = Xapian::Query();
1056
1056
1057
    if (m_text.empty()) {
1057
    if (m_text.empty()) {
1058
    LOGERR(("SearchDataClausePath: empty path??\n"));
1058
    LOGERR(("SearchDataClausePath: empty path??\n"));
1059
  m_reason = "Empty path ?";
1059
    return false;
1060
    return false;
1060
    }
1061
    }
1062
1063
    vector<Xapian::Query> orqueries;
1064
1065
    if (m_text[0] == '/')
1066
  orqueries.push_back(Xapian::Query(wrap_prefix(pathelt_prefix)));
1067
1061
    vector<string> vpath;
1068
    vector<string> vpath;
1062
    stringToTokens(m_text, vpath, "/");
1069
    stringToTokens(m_text, vpath, "/");
1063
    vector<string> pvpath;
1070
1064
    if (m_text[0] == '/')
1065
  pvpath.push_back(wrap_prefix(pathelt_prefix));
1066
    for (vector<string>::const_iterator pit = vpath.begin(); 
1071
    for (vector<string>::const_iterator pit = vpath.begin(); 
1067
     pit != vpath.end(); pit++){
1072
     pit != vpath.end(); pit++){
1068
  pvpath.push_back(wrap_prefix(pathelt_prefix) + *pit);
1073
1074
  string sterm;
1075
  vector<string> exp;
1076
  if (!expandTerm(db, m_reason, 
1077
          SDCM_NOSTEMMING|SDCM_CASESENS|SDCM_DIACSENS,
1078
          *pit, exp, sterm, wrap_prefix(pathelt_prefix))) {
1079
      return false;
1080
  }
1081
  LOGDEB0(("SDataPath::toNative: exp size %d\n", exp.size()));
1082
  listVector("", exp);
1083
  if (exp.size() == 1)
1084
      orqueries.push_back(Xapian::Query(exp[0]));
1085
  else 
1086
      orqueries.push_back(Xapian::Query(Xapian::Query::OP_OR, 
1087
                        exp.begin(), exp.end()));
1088
  m_curcl += exp.size();
1089
  if (m_curcl >= getMaxCl())
1090
      return false;
1069
    }
1091
    }
1092
1070
    *qp = Xapian::Query(Xapian::Query::OP_PHRASE, 
1093
    *qp = Xapian::Query(Xapian::Query::OP_PHRASE, 
1071
          pvpath.begin(), pvpath.end());
1094
          orqueries.begin(), orqueries.end());
1072
1095
1073
    if (m_weight != 1.0) {
1096
    if (m_weight != 1.0) {
1074
    *qp = Xapian::Query(Xapian::Query::OP_SCALE_WEIGHT, *qp, m_weight);
1097
    *qp = Xapian::Query(Xapian::Query::OP_SCALE_WEIGHT, *qp, m_weight);
1075
    }
1098
    }
1076
    return true;
1099
    return true;