mode 700 on .recoll. move showquerydetails to rclreslist
This commit is contained in:
+12
-12
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: sortseq.cpp,v 1.6 2006-01-23 13:32:28 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: sortseq.cpp,v 1.7 2006-04-20 09:20:10 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -82,15 +82,15 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
DocSeqSorted::DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec,
|
||||
DocSeqSorted::DocSeqSorted(DocSequence &iseq, RclSortSpec &sortspec,
|
||||
const std::string &t)
|
||||
: DocSequence(t)
|
||||
{
|
||||
LOGDEB(("DocSeqSorted:: count %d\n", cnt));
|
||||
|
||||
m_docs.resize(cnt);
|
||||
m_spec = sortspec;
|
||||
LOGDEB(("DocSeqSorted:: count %d\n", m_spec.sortwidth));
|
||||
m_docs.resize(m_spec.sortwidth);
|
||||
int i;
|
||||
for (i = 0; i < cnt; i++) {
|
||||
for (i = 0; i < m_spec.sortwidth; i++) {
|
||||
int percent;
|
||||
if (!iseq.getDoc(i, m_docs[i], &percent)) {
|
||||
LOGERR(("DocSeqSorted: getDoc failed for doc %d\n", i));
|
||||
@@ -98,11 +98,11 @@ DocSeqSorted::DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec,
|
||||
}
|
||||
m_docs[i].pc = percent;
|
||||
}
|
||||
m_count = i;
|
||||
LOGDEB(("DocSeqSorted:: m_count %d\n", m_count));
|
||||
m_docs.resize(m_count);
|
||||
m_docsp.resize(m_count);
|
||||
for (i = 0; i < m_count; i++)
|
||||
m_spec.sortwidth = i;
|
||||
LOGDEB(("DocSeqSorted:: m_count %d\n", m_spec.sortwidth));
|
||||
m_docs.resize(m_spec.sortwidth);
|
||||
m_docsp.resize(m_spec.sortwidth);
|
||||
for (i = 0; i < m_spec.sortwidth; i++)
|
||||
m_docsp[i] = &m_docs[i];
|
||||
|
||||
CompareDocs cmp(sortspec);
|
||||
@@ -113,7 +113,7 @@ bool DocSeqSorted::getDoc(int num, Rcl::Doc &doc, int *percent, string *)
|
||||
{
|
||||
LOGDEB1(("DocSeqSorted: fetching %d\n", num));
|
||||
|
||||
if (num >= m_count)
|
||||
if (num >= m_spec.sortwidth)
|
||||
return false;
|
||||
if (percent)
|
||||
*percent = (*m_docsp[num]).pc;
|
||||
|
||||
+6
-4
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
#ifndef _SORTSEQ_H_INCLUDED_
|
||||
#define _SORTSEQ_H_INCLUDED_
|
||||
/* @(#$Id: sortseq.h,v 1.5 2006-02-21 12:52:48 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: sortseq.h,v 1.6 2006-04-20 09:20:10 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
class RclSortSpec {
|
||||
public:
|
||||
RclSortSpec() : sortwidth(0) {}
|
||||
int sortwidth; // We only re-sort the first sortwidth most relevant docs
|
||||
enum Field {RCLFLD_URL, RCLFLD_IPATH, RCLFLD_MIMETYPE, RCLFLD_MTIME};
|
||||
void addCrit(Field fld, bool desc = false) {
|
||||
crits.push_back(fld);
|
||||
@@ -40,14 +42,14 @@ class RclSortSpec {
|
||||
*/
|
||||
class DocSeqSorted : public DocSequence {
|
||||
public:
|
||||
DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec,
|
||||
DocSeqSorted(DocSequence &iseq, RclSortSpec &sortspec,
|
||||
const std::string &t);
|
||||
virtual ~DocSeqSorted() {}
|
||||
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0);
|
||||
virtual int getResCnt() {return m_count;}
|
||||
virtual int getResCnt() {return m_spec.sortwidth;}
|
||||
|
||||
private:
|
||||
int m_count;
|
||||
RclSortSpec m_spec;
|
||||
std::vector<Rcl::Doc> m_docs;
|
||||
std::vector<Rcl::Doc *> m_docsp;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user