Separate count and context for snippets in the snippets popup from the default values for the result list
This commit is contained in:
@@ -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
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user