Switch to unified view

a/src/query/wasatorcl.cpp b/src/query/wasatorcl.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: wasatorcl.cpp,v 1.13 2008-01-16 11:14:38 dockes Exp $ (C) 2006 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: wasatorcl.cpp,v 1.14 2008-08-26 13:47:21 dockes Exp $ (C) 2006 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
66
    case WasaQuery::OP_AND:
66
    case WasaQuery::OP_AND:
67
    default:
67
    default:
68
        LOGINFO(("wasaQueryToRcl: found bad NULL or AND q type in list\n"));
68
        LOGINFO(("wasaQueryToRcl: found bad NULL or AND q type in list\n"));
69
        continue;
69
        continue;
70
    case WasaQuery::OP_LEAF:
70
    case WasaQuery::OP_LEAF:
71
71
      unsigned int mods = (unsigned int)(*it)->m_modifiers;
72
        // Special cases (mime, category, dir filter ...). Not pretty.
72
        // Special cases (mime, category, dir filter ...). Not pretty.
73
        if (!stringicmp("mime", (*it)->m_fieldspec)) {
73
        if (!stringicmp("mime", (*it)->m_fieldspec) ||
74
      !stringicmp("format", (*it)->m_fieldspec)
75
      ) {
74
        sdata->addFiletype((*it)->m_value);
76
        sdata->addFiletype((*it)->m_value);
75
        break;
77
        break;
76
        } 
78
        } 
77
79
78
        // Xesam uses "type", we also support "rclcat", for broad
80
        // Xesam uses "type", we also support "rclcat", for broad
...
...
93
        sdata->setTopdir((*it)->m_value);
95
        sdata->setTopdir((*it)->m_value);
94
        break;
96
        break;
95
        } 
97
        } 
96
98
97
        if ((*it)->m_value.find_first_of(" \t\n\r") != string::npos) {
99
        if ((*it)->m_value.find_first_of(" \t\n\r") != string::npos) {
98
      nclause = new Rcl::SearchDataClauseDist(Rcl::SCLT_PHRASE, 
100
      int slack = (mods & WasaQuery::WQM_PHRASESLACK) ? 10 : 0;
99
                          (*it)->m_value, 0, 
101
      Rcl::SClType tp = Rcl::SCLT_PHRASE;
102
      if (mods & WasaQuery::WQM_PROX) {
103
          tp = Rcl::SCLT_NEAR;
104
          slack = 10;
105
      }
106
      nclause = new Rcl::SearchDataClauseDist(tp, (*it)->m_value,
107
                          slack,
100
                            (*it)->m_fieldspec);
108
                            (*it)->m_fieldspec);
101
        } else {
109
        } else {
102
        nclause = new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND, 
110
        nclause = new Rcl::SearchDataClauseSimple(Rcl::SCLT_AND, 
103
                              (*it)->m_value, 
111
                              (*it)->m_value, 
104
                              (*it)->m_fieldspec);
112
                              (*it)->m_fieldspec);