Switch to unified view

a/src/query/docseq.h b/src/query/docseq.h
...
...
91
    virtual int getSeqSlice(int offs, int cnt, vector<ResListEntry>& result);
91
    virtual int getSeqSlice(int offs, int cnt, vector<ResListEntry>& result);
92
92
93
    /** Get abstract for document. This is special because it may take time.
93
    /** Get abstract for document. This is special because it may take time.
94
     *  The default is to return the input doc's abstract fields, but some 
94
     *  The default is to return the input doc's abstract fields, but some 
95
     *  sequences can compute a better value (ie: docseqdb) */
95
     *  sequences can compute a better value (ie: docseqdb) */
96
    virtual bool getAbstract(Rcl::Doc& doc, vector<string>& abs) {
97
  abs.push_back(doc.meta[Rcl::Doc::keyabs]);
98
  return true;
99
    }
96
    virtual string getAbstract(Rcl::Doc& doc) {
100
    virtual string getAbstract(Rcl::Doc& doc) {
97
  return doc.meta[Rcl::Doc::keyabs];
101
  vector<string> v;
102
  getAbstract(doc, v);
103
  string abstract;
104
  for (vector<string>::const_iterator it = v.begin();
105
       it != v.end(); it++) {
106
      abstract += *it;
107
      abstract += "... ";
108
  }
109
  return abstract;
98
    }
110
    }
99
100
    virtual bool getEnclosing(Rcl::Doc&, Rcl::Doc&) = 0;
111
    virtual bool getEnclosing(Rcl::Doc&, Rcl::Doc&) = 0;
101
112
102
    /** Get estimated total count in results */
113
    /** Get estimated total count in results */
103
    virtual int getResCnt() = 0;
114
    virtual int getResCnt() = 0;
104
115
...
...
150
    DocSeqModifier(RefCntr<DocSequence> iseq) 
161
    DocSeqModifier(RefCntr<DocSequence> iseq) 
151
    : DocSequence(""), m_seq(iseq) 
162
    : DocSequence(""), m_seq(iseq) 
152
    {}
163
    {}
153
    virtual ~DocSeqModifier() {}
164
    virtual ~DocSeqModifier() {}
154
165
166
    virtual bool getAbstract(Rcl::Doc& doc, vector<string>& abs) 
167
    {
168
  if (m_seq.isNull())
169
      return false;
170
  return m_seq->getAbstract(doc, abs);
171
    }
155
    virtual string getAbstract(Rcl::Doc& doc) 
172
    virtual string getAbstract(Rcl::Doc& doc)
156
    {
173
    {
157
    if (m_seq.isNull())
174
    if (m_seq.isNull())
158
        return "";
175
        return "";
159
    return m_seq->getAbstract(doc);
176
    return m_seq->getAbstract(doc);
160
    }
177
    }