Only create the snippets menu entry if doc has pages. Add code for a snippets window link inside the result list
This commit is contained in:
+12
-1
@@ -112,10 +112,17 @@ class Doc {
|
||||
// and indexed
|
||||
string text;
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Misc stuff
|
||||
|
||||
int pc; // relevancy percentage, used by sortseq, convenience
|
||||
unsigned long xdocid; // Opaque: rcldb doc identifier.
|
||||
|
||||
// Page breaks were stored during indexing.
|
||||
bool haspages;
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
void erase() {
|
||||
url.erase();
|
||||
ipath.erase();
|
||||
@@ -133,8 +140,12 @@ class Doc {
|
||||
text.erase();
|
||||
pc = 0;
|
||||
xdocid = 0;
|
||||
haspages = false;
|
||||
}
|
||||
Doc()
|
||||
: syntabs(false), pc(0), xdocid(0), haspages(false)
|
||||
{
|
||||
}
|
||||
|
||||
/** Get value for named field. If value pointer is 0, just test existence */
|
||||
bool getmeta(const string& nm, string *value = 0) const
|
||||
{
|
||||
|
||||
@@ -325,6 +325,7 @@ bool Query::makeDocAbstract(Doc &doc, vector<string>& abstract)
|
||||
it != vpabs.end(); it++) {
|
||||
string chunk;
|
||||
if (it->first > 0) {
|
||||
doc.haspages = true;
|
||||
ostringstream ss;
|
||||
ss << it->first;
|
||||
chunk += string(" [p ") + ss.str() + "] ";
|
||||
|
||||
Reference in New Issue
Block a user