From ce607032fa8e25b2773d3bdbb925f0be0e0d8fe9 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Mon, 9 May 2011 20:49:15 +0200 Subject: [PATCH] Fix a number of potential or actual static object initialization issues --- src/rcldb/rclquery.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/rcldb/rclquery.cpp b/src/rcldb/rclquery.cpp index 413e19ca..bf9501a0 100644 --- a/src/rcldb/rclquery.cpp +++ b/src/rcldb/rclquery.cpp @@ -39,6 +39,21 @@ namespace Rcl { #endif +// Field names inside the index data record may differ from the rcldoc ones +// (esp.: caption / title) +static const string& docfToDatf(const string& df) +{ + static const string keycap("caption"); + static const string keydmtime("dmtime"); + if (!df.compare(Doc::keytt)) { + return keycap; + } else if (!df.compare(Doc::keymt)) { + return keydmtime; + } else { + return df; + } +} + // Sort helper class class QSorter : public Xapian::Sorter { public: