Switch to unified view

a/src/query/wasatorcl.cpp b/src/query/wasatorcl.cpp
...
...
132
        reason = "Found bad NULL or AND query type in list";
132
        reason = "Found bad NULL or AND query type in list";
133
        LOGERR(("wasaQueryToRcl: found bad NULL or AND q type in list\n"));
133
        LOGERR(("wasaQueryToRcl: found bad NULL or AND q type in list\n"));
134
        continue;
134
        continue;
135
135
136
    case WasaQuery::OP_LEAF: {
136
    case WasaQuery::OP_LEAF: {
137
        LOGDEB2(("wasaQueryToRcl: leaf clause [%s]:[%s]\n", 
137
        LOGDEB(("wasaQueryToRcl: leaf clause [%s]:[%s] slack %d\n", 
138
             (*it)->m_fieldspec.c_str(), (*it)->m_value.c_str()));
138
            (*it)->m_fieldspec.c_str(), (*it)->m_value.c_str(),
139
          (*it)->m_slack));
139
140
140
            // Change terms found in the "autosuffs" list into "ext"
141
            // Change terms found in the "autosuffs" list into "ext"
141
            // field queries
142
            // field queries
142
            if ((*it)->m_fieldspec.empty() && !autosuffs.empty()) {
143
            if ((*it)->m_fieldspec.empty() && !autosuffs.empty()) {
143
                vector<string> asfv;
144
                vector<string> asfv;
...
...
150
                }
151
                }
151
            }
152
            }
152
153
153
        unsigned int mods = (unsigned int)(*it)->m_modifiers;
154
        unsigned int mods = (unsigned int)(*it)->m_modifiers;
154
155
156
      // I'm not sure I understand the phrase/near detection
157
      // thereafter anymore, maybe it would be better to have an
158
      // explicit flag. Mods can only be set after a double
159
      // quote.
155
        if (TextSplit::hasVisibleWhite((*it)->m_value)) {
160
        if (TextSplit::hasVisibleWhite((*it)->m_value) || mods) {
156
      int slack = (mods & WasaQuery::WQM_PHRASESLACK) ? 10 : 0;
157
        Rcl::SClType tp = Rcl::SCLT_PHRASE;
161
        Rcl::SClType tp = Rcl::SCLT_PHRASE;
158
        if (mods & WasaQuery::WQM_PROX) {
162
        if (mods & WasaQuery::WQM_PROX) {
159
            tp = Rcl::SCLT_NEAR;
163
            tp = Rcl::SCLT_NEAR;
160
          slack = 10;
161
        }
164
        }
162
        nclause = new Rcl::SearchDataClauseDist(tp, (*it)->m_value,
165
        nclause = new Rcl::SearchDataClauseDist(tp, (*it)->m_value,
163
                            slack,
166
                            (*it)->m_slack,
164
                            (*it)->m_fieldspec);
167
                            (*it)->m_fieldspec);
165
        } else {
168
        } else {
166
        nclause = new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND, 
169
        nclause = new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND, 
167
                              (*it)->m_value, 
170
                              (*it)->m_value, 
168
                              (*it)->m_fieldspec);
171
                              (*it)->m_fieldspec);
...
...
171
        reason = "Out of memory";
174
        reason = "Out of memory";
172
        LOGERR(("wasaQueryToRcl: out of memory\n"));
175
        LOGERR(("wasaQueryToRcl: out of memory\n"));
173
        return 0;
176
        return 0;
174
        }
177
        }
175
        if (mods & WasaQuery::WQM_NOSTEM) {
178
        if (mods & WasaQuery::WQM_NOSTEM) {
176
        nclause->setModifiers(Rcl::SearchDataClause::SDCM_NOSTEMMING);
179
        nclause->addModifier(Rcl::SearchDataClause::SDCM_NOSTEMMING);
177
        }
180
        }
178
        if ((*it)->m_weight != 1.0)
181
        if ((*it)->m_weight != 1.0)
179
        nclause->setWeight((*it)->m_weight);
182
        nclause->setWeight((*it)->m_weight);
180
        sdata->addClause(nclause);
183
        sdata->addClause(nclause);
181
    }
184
    }