Separate count and context for snippets in the snippets popup from the default values for the result list

This commit is contained in:
"Jean-Francois Dockes ext:(%22)
2012-09-23 18:19:43 +02:00
parent a77edbd6b1
commit ab32062fcc
10 changed files with 99 additions and 33 deletions
-1
View File
@@ -98,7 +98,6 @@ class DocSequence {
virtual bool getAbstract(Rcl::Doc& doc,
std::vector<std::pair<int, std::string> >& abs)
{
fprintf(stderr, "DocSequence::getAbstract/pair\n");
abs.push_back(std::pair<int, std::string>(0,
doc.meta[Rcl::Doc::keyabs]));
return true;
+16 -3
View File
@@ -65,19 +65,32 @@ int DocSequenceDb::getResCnt()
return m_rescnt;
}
// This one only gets called to fill-up the snippets window
// We ignore most abstract/snippets preferences.
bool DocSequenceDb::getAbstract(Rcl::Doc &doc,
vector<pair<int, string> >& vpabs)
{
LOGDEB(("DocSequenceDb::getAbstract/pair\n"));
setQuery();
if (m_q->whatDb() &&
m_queryBuildAbstract && (doc.syntabs || m_queryReplaceAbstract)) {
m_q->whatDb()->makeDocAbstract(doc, m_q.getptr(), vpabs);
// Have to put the limit somewhere.
int maxoccs = 500;
Rcl::abstract_result ret = Rcl::ABSRES_ERROR;
if (m_q->whatDb()) {
ret = m_q->whatDb()->makeDocAbstract(doc, m_q.getptr(), vpabs,
maxoccs,
m_q->whatDb()->getAbsCtxLen()+ 2);
}
if (vpabs.empty())
vpabs.push_back(pair<int, string>(0, doc.meta[Rcl::Doc::keyabs]));
// If the list was probably truncated, indicate it.
if (ret == Rcl::ABSRES_TRUNC)
vpabs.push_back(pair<int, string>(-1, "[...]"));
return true;
}
bool DocSequenceDb::getAbstract(Rcl::Doc &doc, vector<string>& vabs)
{
setQuery();
+4
View File
@@ -31,7 +31,11 @@ class DocSequenceDb : public DocSequence {
virtual bool getDoc(int num, Rcl::Doc &doc, string * = 0);
virtual int getResCnt();
virtual void getTerms(HighlightData& hld);
// Called to fill-up the snippets window. Ignoers
// buildabstract/replaceabstract and syntabslen
virtual bool getAbstract(Rcl::Doc &doc, vector<pair<int, string> >&);
virtual bool getAbstract(Rcl::Doc &doc, vector<string>&);
virtual int getFirstMatchPage(Rcl::Doc&);
virtual bool getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc);