mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Improve retrocompatibility with older xapian
This commit is contained in:
parent
ff166b2295
commit
6982ae6cd5
1 changed files with 9 additions and 1 deletions
|
@ -25,6 +25,13 @@
|
||||||
#include "retroshare/rsinit.h"
|
#include "retroshare/rsinit.h"
|
||||||
#include "util/rsurl.h"
|
#include "util/rsurl.h"
|
||||||
|
|
||||||
|
#ifndef XAPIAN_AT_LEAST
|
||||||
|
#define XAPIAN_AT_LEAST(A,B,C) (XAPIAN_MAJOR_VERSION > (A) || \
|
||||||
|
(XAPIAN_MAJOR_VERSION == (A) && \
|
||||||
|
(XAPIAN_MINOR_VERSION > (B) || \
|
||||||
|
(XAPIAN_MINOR_VERSION == (B) && XAPIAN_REVISION >= (C)))))
|
||||||
|
#endif // ndef XAPIAN_AT_LEAST
|
||||||
|
|
||||||
struct DeepSearch
|
struct DeepSearch
|
||||||
{
|
{
|
||||||
struct SearchResult
|
struct SearchResult
|
||||||
|
@ -66,10 +73,11 @@ struct DeepSearch
|
||||||
for ( Xapian::MSetIterator m = mset.begin(); m != mset.end(); ++m )
|
for ( Xapian::MSetIterator m = mset.begin(); m != mset.end(); ++m )
|
||||||
{
|
{
|
||||||
const Xapian::Document& doc = m.get_document();
|
const Xapian::Document& doc = m.get_document();
|
||||||
|
|
||||||
SearchResult s;
|
SearchResult s;
|
||||||
s.mUrl = doc.get_value(URL_VALUENO);
|
s.mUrl = doc.get_value(URL_VALUENO);
|
||||||
|
#if XAPIAN_AT_LEAST(1,3,5)
|
||||||
s.mSnippet = mset.snippet(doc.get_data());
|
s.mSnippet = mset.snippet(doc.get_data());
|
||||||
|
#endif // XAPIAN_AT_LEAST(1,3,5)
|
||||||
results.push_back(s);
|
results.push_back(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue