← Back to team overview

zeitgeist team mailing list archive

[Branch ~zeitgeist/zeitgeist/bluebird] Rev 414: Use a const int for relevancy result type

 

------------------------------------------------------------
revno: 414
committer: Michal Hruby <michal.mhr@xxxxxxxxx>
branch nick: zeitgeist
timestamp: Wed 2012-03-07 16:56:30 +0100
message:
  Use a const int for relevancy result type
modified:
  extensions/fts++/indexer.cpp


--
lp:zeitgeist
https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird

Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist.
To unsubscribe from this branch go to https://code.launchpad.net/~zeitgeist/zeitgeist/bluebird/+edit-subscription
=== modified file 'extensions/fts++/indexer.cpp'
--- extensions/fts++/indexer.cpp	2012-03-06 22:03:17 +0000
+++ extensions/fts++/indexer.cpp	2012-03-07 15:56:30 +0000
@@ -49,6 +49,7 @@
   Xapian::QueryParser::FLAG_WILDCARD
 
 const std::string FTS_MAIN_DIR = "fts.index";
+const int RELEVANCY_RESULT_TYPE = 100;
 
 void Indexer::Initialize (GError **error)
 {
@@ -725,7 +726,7 @@
     // from the Xapian index because the final result set will be coalesced
     // on some property of the event
     guint maxhits;
-    if (result_type == 100 ||
+    if (result_type == RELEVANCY_RESULT_TYPE ||
         result_type == ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS ||
         result_type == ZEITGEIST_RESULT_TYPE_LEAST_RECENT_EVENTS)
     {
@@ -736,7 +737,7 @@
       maxhits = count * 3;
     }
 
-    if (result_type == 100)
+    if (result_type == RELEVANCY_RESULT_TYPE)
     {
       enquire->set_sort_by_relevance ();
     }
@@ -750,7 +751,7 @@
     Xapian::MSet hits (enquire->get_mset (offset, maxhits));
     Xapian::doccount hitcount = hits.get_matches_estimated ();
 
-    if (result_type == 100)
+    if (result_type == RELEVANCY_RESULT_TYPE)
     {
       std::vector<unsigned> event_ids;
       for (Xapian::MSetIterator iter = hits.begin (); iter != hits.end (); ++iter)
@@ -840,7 +841,7 @@
 
     guint maxhits = count;
 
-    if (result_type == 100)
+    if (result_type == RELEVANCY_RESULT_TYPE)
     {
       enquire->set_sort_by_relevance ();
     }
@@ -863,7 +864,7 @@
     Xapian::MSet hits (enquire->get_mset (offset, maxhits));
     Xapian::doccount hitcount = hits.get_matches_estimated ();
 
-    if (result_type == 100)
+    if (result_type == RELEVANCY_RESULT_TYPE)
     {
       std::vector<unsigned> event_ids;
       std::vector<gdouble> relevancy_arr;