recollq: added option -p to be used with -A for showing page-numbered snippets instead of abstract

This commit is contained in:
Jean-Francois Dockes
2020-08-29 09:43:21 +02:00
parent 92f636be39
commit 20e845709e
3 changed files with 93 additions and 69 deletions
+6 -10
View File
@@ -40,11 +40,8 @@ enum abstract_result {
class Snippet {
public:
Snippet(int page, const std::string& snip)
: page(page), snippet(snip)
{
}
Snippet& setTerm(const std::string& trm)
{
: page(page), snippet(snip) {}
Snippet& setTerm(const std::string& trm) {
term = trm;
return *this;
}
@@ -65,6 +62,9 @@ public:
Query(Db *db);
~Query();
Query(const Query &) = delete;
Query& operator=(const Query &) = delete;
/** Get explanation about last error */
std::string getReason() const {
return m_reason;
@@ -114,7 +114,7 @@ public:
bool makeDocAbstract(const Doc &doc, std::vector<std::string>& abstract);
// Returned as a vector of pair<page,snippet> page is 0 if unknown
int makeDocAbstract(const Doc &doc, std::vector<Snippet>& abst,
int maxoccs= -1, int ctxwords = -1, bool sortbypage=false);
int maxoccs= -1, int ctxwords= -1,bool sortbypage=false);
/** Retrieve page number for first match for "significant" query term
* @param term returns the chosen term */
int getFirstMatchPage(const Doc &doc, std::string& term);
@@ -146,10 +146,6 @@ private:
int m_resCnt;
std::shared_ptr<SearchData> m_sd;
int m_snipMaxPosWalk;
/* Copyconst and assignement private and forbidden */
Query(const Query &) {}
Query & operator=(const Query &) {return *this;};
};
#ifndef NO_NAMESPACES