add functions and interface to display the duplicates of a result document
This commit is contained in:
@@ -108,6 +108,11 @@ class DocSequence {
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/** Get duplicates. */
|
||||
virtual bool docDups(const Rcl::Doc&, std::vector<Rcl::Doc>&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool getEnclosing(Rcl::Doc&, Rcl::Doc&) = 0;
|
||||
|
||||
@@ -185,6 +190,13 @@ public:
|
||||
return false;
|
||||
return m_seq->getAbstract(doc, abs);
|
||||
}
|
||||
/** Get duplicates. */
|
||||
virtual bool docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups)
|
||||
{
|
||||
if (m_seq.isNull())
|
||||
return false;
|
||||
return m_seq->docDups(doc, dups);
|
||||
}
|
||||
|
||||
virtual bool snippetsCapable()
|
||||
{
|
||||
|
||||
@@ -239,3 +239,12 @@ bool DocSequenceDb::setQuery()
|
||||
}
|
||||
return m_lastSQStatus;
|
||||
}
|
||||
|
||||
bool DocSequenceDb::docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups)
|
||||
{
|
||||
if (m_q->whatDb()) {
|
||||
return m_q->whatDb()->docDups(doc, dups);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ class DocSequenceDb : public DocSequence {
|
||||
virtual bool getAbstract(Rcl::Doc &doc, vector<string>&);
|
||||
virtual int getFirstMatchPage(Rcl::Doc&, std::string& term);
|
||||
virtual bool getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc);
|
||||
virtual bool docDups(const Rcl::Doc& doc, std::vector<Rcl::Doc>& dups);
|
||||
virtual string getDescription();
|
||||
virtual list<string> expand(Rcl::Doc &doc);
|
||||
virtual bool canFilter() {return true;}
|
||||
|
||||
@@ -255,6 +255,15 @@ void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc,
|
||||
linksbuf << " " << snipsbuf.str();
|
||||
}
|
||||
|
||||
string collapscnt;
|
||||
if (doc.getmeta(Rcl::Doc::keycc, &collapscnt) && !collapscnt.empty()) {
|
||||
ostringstream collpsbuf;
|
||||
int clc = atoi(collapscnt.c_str()) + 1;
|
||||
collpsbuf << "<a href=\"D" << docnumforlinks << "\">"
|
||||
<< trans("Dups") << "(" << clc << ")" << "</a> ";
|
||||
linksbuf << " " << collpsbuf.str();
|
||||
}
|
||||
|
||||
// Build the result list paragraph:
|
||||
|
||||
// Subheader: this is used by history
|
||||
|
||||
Reference in New Issue
Block a user