forked from organicmaps/organicmaps-tmp
[booking] deals filter review fixes
This commit is contained in:
parent
238b4be6a7
commit
f9d2cd30d6
19 changed files with 90 additions and 78 deletions
|
@ -425,7 +425,7 @@ void OnBookmarksSearchResults(search::BookmarksSearchParams::Results const & res
|
|||
env->CallVoidMethod(g_javaListener, method, jResults.get(), static_cast<jlong>(timestamp));
|
||||
}
|
||||
|
||||
void OnBookingFilterAvailabilityResults(std::shared_ptr<booking::ParamsBase> const & apiParams,
|
||||
void OnBookingFilterAvailabilityResults(shared_ptr<booking::ParamsBase> const & apiParams,
|
||||
vector<FeatureID> const & featuresSorted)
|
||||
{
|
||||
auto const it = g_lastBookingFilterTasks.Find(booking::filter::Type::Availability);
|
||||
|
@ -437,7 +437,7 @@ void OnBookingFilterAvailabilityResults(std::shared_ptr<booking::ParamsBase> con
|
|||
if (!it->m_filterParams.m_apiParams->Equals(*apiParams))
|
||||
return;
|
||||
|
||||
ASSERT(std::is_sorted(featuresSorted.cbegin(), featuresSorted.cend()), ());
|
||||
ASSERT(is_sorted(featuresSorted.cbegin(), featuresSorted.cend()), ());
|
||||
|
||||
JNIEnv * env = jni::GetEnv();
|
||||
jni::TScopedLocalObjectArrayRef jResults(env,
|
||||
|
@ -446,7 +446,7 @@ void OnBookingFilterAvailabilityResults(std::shared_ptr<booking::ParamsBase> con
|
|||
static_cast<jint>(booking::filter::Type::Availability), jResults.get());
|
||||
}
|
||||
|
||||
void OnBookingFilterDealsResults(std::shared_ptr<booking::ParamsBase> const & apiParams,
|
||||
void OnBookingFilterDealsResults(shared_ptr<booking::ParamsBase> const & apiParams,
|
||||
vector<FeatureID> const & featuresSorted)
|
||||
{
|
||||
auto const it = g_lastBookingFilterTasks.Find(booking::filter::Type::Deals);
|
||||
|
@ -455,10 +455,10 @@ void OnBookingFilterDealsResults(std::shared_ptr<booking::ParamsBase> const & ap
|
|||
return;
|
||||
|
||||
// Ignore obsolete booking filter results.
|
||||
if (!it->m_filterParams.m_apiParams->Equals(*(apiParams)))
|
||||
if (!it->m_filterParams.m_apiParams->Equals(*apiParams))
|
||||
return;
|
||||
|
||||
ASSERT(std::is_sorted(featuresSorted.cbegin(), featuresSorted.cend()), ());
|
||||
ASSERT(is_sorted(featuresSorted.cbegin(), featuresSorted.cend()), ());
|
||||
|
||||
JNIEnv * env = jni::GetEnv();
|
||||
jni::TScopedLocalObjectArrayRef jResults(env,
|
||||
|
@ -504,7 +504,7 @@ public:
|
|||
|
||||
jobjectArray const jrooms =
|
||||
static_cast<jobjectArray>(env->GetObjectField(bookingFilterParams, m_roomsId));
|
||||
ASSERT(jrooms, ("Rooms musn't be non-null!"));
|
||||
ASSERT(jrooms, ("Rooms must be non-null!"));
|
||||
|
||||
auto const length = static_cast<size_t>(env->GetArrayLength(jrooms));
|
||||
result.m_rooms.resize(length);
|
||||
|
@ -551,7 +551,7 @@ public:
|
|||
|
||||
if (!availabilityParams.IsEmpty())
|
||||
{
|
||||
booking::filter::Params p(std::make_shared<booking::AvailabilityParams>(availabilityParams),
|
||||
booking::filter::Params p(make_shared<booking::AvailabilityParams>(availabilityParams),
|
||||
bind(&::OnBookingFilterAvailabilityResults, _1, _2));
|
||||
|
||||
tasks.EmplaceBack(booking::filter::Type::Availability, move(p));
|
||||
|
@ -561,7 +561,7 @@ public:
|
|||
|
||||
if (!dealsParams.IsEmpty())
|
||||
{
|
||||
booking::filter::Params p(std::make_shared<booking::AvailabilityParams>(dealsParams),
|
||||
booking::filter::Params p(make_shared<booking::AvailabilityParams>(dealsParams),
|
||||
bind(&::OnBookingFilterDealsResults, _1, _2));
|
||||
|
||||
tasks.EmplaceBack(booking::filter::Type::Deals, move(p));
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "com/mapswithme/core/jni_helper.hpp"
|
||||
|
||||
#include "map/everywhere_search_callback.hpp"
|
||||
|
||||
#include "search/result.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
|
|
@ -169,8 +169,8 @@ using Observers = NSHashTable<Observer>;
|
|||
dp.m_dealsOnly = true;
|
||||
booking::filter::Params dealsParams(std::make_shared<booking::AvailabilityParams>(dp), {});
|
||||
|
||||
tasks.EmplaceBack(booking::filter::Type::Availability, move(availabilityParams));
|
||||
tasks.EmplaceBack(booking::filter::Type::Deals, move(dealsParams));
|
||||
tasks.EmplaceBack(booking::filter::Type::Availability, std::move(availabilityParams));
|
||||
tasks.EmplaceBack(booking::filter::Type::Deals, std::move(dealsParams));
|
||||
}
|
||||
|
||||
m_viewportParams.m_bookingFilterTasks = tasks;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#import "MWMSearchCell.h"
|
||||
|
||||
#include "map/everywhere_search_callback.hpp"
|
||||
|
||||
#include "search/result.hpp"
|
||||
|
||||
@interface MWMSearchCommonCell : MWMSearchCell
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "indexer/feature_decl.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
@ -68,13 +69,13 @@ struct TaskImpl
|
|||
using Task = TaskImpl<Params>;
|
||||
using TaskInternal = TaskImpl<ParamsInternal>;
|
||||
|
||||
enum ApplyMode
|
||||
enum ApplicationMode
|
||||
{
|
||||
/// Apply filters independently on provided list of search results.
|
||||
/// Every filter will be applied on own copy of search results.
|
||||
/// Every filter will be applied on its own copy of search results.
|
||||
Independent,
|
||||
/// Apply each filter one by one on provided list of search results.
|
||||
/// All filters will be applied on joint copy of search results.
|
||||
/// All filters will be applied on the same copy of search results.
|
||||
Consecutive
|
||||
};
|
||||
|
||||
|
@ -86,7 +87,7 @@ public:
|
|||
using ConstIter = std::vector<Task>::const_iterator;
|
||||
|
||||
TasksImpl() = default;
|
||||
explicit TasksImpl(ApplyMode const mode) : m_applyMode(mode) {}
|
||||
explicit TasksImpl(ApplicationMode const mode) : m_applyMode(mode) {}
|
||||
|
||||
Iter begin() { return m_tasks.begin(); }
|
||||
Iter end() { return m_tasks.end(); }
|
||||
|
@ -95,7 +96,7 @@ public:
|
|||
|
||||
Iter Find(Type const type)
|
||||
{
|
||||
return find_if(m_tasks.begin(), m_tasks.end(),[type](Task const & task)
|
||||
return std::find_if(m_tasks.begin(), m_tasks.end(),[type](Task const & task)
|
||||
{
|
||||
return task.m_type == type;
|
||||
});
|
||||
|
@ -103,7 +104,7 @@ public:
|
|||
|
||||
ConstIter Find(Type const type) const
|
||||
{
|
||||
return find_if(m_tasks.cbegin(), m_tasks.cend(),[type](Task const & task)
|
||||
return std::find_if(m_tasks.cbegin(), m_tasks.cend(),[type](Task const & task)
|
||||
{
|
||||
return task.m_type == type;
|
||||
});
|
||||
|
@ -120,14 +121,14 @@ public:
|
|||
m_tasks.emplace_back(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
ApplyMode GetMode() const
|
||||
ApplicationMode GetMode() const
|
||||
{
|
||||
return m_applyMode;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<T> m_tasks;
|
||||
ApplyMode m_applyMode = ApplyMode::Independent;
|
||||
ApplicationMode m_applyMode = ApplicationMode::Independent;
|
||||
};
|
||||
|
||||
using Tasks = TasksImpl<Task>;
|
||||
|
|
|
@ -16,7 +16,7 @@ FilterProcessor::FilterProcessor(Index const & index, booking::Api const & api)
|
|||
}
|
||||
|
||||
void FilterProcessor::ApplyFilters(search::Results const & results, TasksInternal && tasks,
|
||||
ApplyMode const mode)
|
||||
ApplicationMode const mode)
|
||||
{
|
||||
GetPlatform().RunTask(Platform::Thread::File, [this, results, tasks = std::move(tasks), mode]() mutable
|
||||
{
|
||||
|
|
|
@ -48,7 +48,8 @@ class FilterProcessor : public FilterBase::Delegate
|
|||
public:
|
||||
FilterProcessor(Index const & index, booking::Api const & api);
|
||||
|
||||
void ApplyFilters(search::Results const & results, TasksInternal && tasks, ApplyMode const mode);
|
||||
void ApplyFilters(search::Results const & results, TasksInternal && tasks,
|
||||
ApplicationMode const mode);
|
||||
|
||||
void OnParamsUpdated(Type const type, std::shared_ptr<ParamsBase> const & params);
|
||||
|
||||
|
@ -62,6 +63,7 @@ public:
|
|||
private:
|
||||
void ApplyConsecutively(search::Results const & results, TasksInternal & tasks);
|
||||
void ApplyIndependently(search::Results const & results, TasksInternal const & tasks);
|
||||
|
||||
Index const & m_index;
|
||||
Api const & m_api;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "everywhere_search_callback.hpp"
|
||||
#include "map/everywhere_search_callback.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
|
|
|
@ -1559,12 +1559,13 @@ size_t Framework::ShowSearchResults(search::Results const & results)
|
|||
|
||||
void Framework::FillSearchResultsMarks(bool clear, search::Results const & results)
|
||||
{
|
||||
FillSearchResultsMarks(clear, results.begin(), results.end());
|
||||
FillSearchResultsMarks(results.begin(), results.end(), clear,
|
||||
Framework::SearchMarkPostProcessing());
|
||||
}
|
||||
|
||||
void Framework::FillSearchResultsMarks(bool clear, search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end,
|
||||
SearchMarkPostProcessing fn /* = nullptr */)
|
||||
void Framework::FillSearchResultsMarks(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear,
|
||||
SearchMarkPostProcessing fn)
|
||||
{
|
||||
auto editSession = GetBookmarkManager().GetEditSession();
|
||||
if (clear)
|
||||
|
@ -3125,15 +3126,16 @@ void Framework::SetSearchDisplacementModeEnabled(bool enabled)
|
|||
SetDisplacementMode(DisplacementModeManager::SLOT_INTERACTIVE_SEARCH, enabled /* show */);
|
||||
}
|
||||
|
||||
void Framework::ShowViewportSearchResults(bool clear, search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end)
|
||||
void Framework::ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear)
|
||||
{
|
||||
FillSearchResultsMarks(clear, begin, end);
|
||||
FillSearchResultsMarks(begin, end, clear,
|
||||
Framework::SearchMarkPostProcessing());
|
||||
}
|
||||
|
||||
void Framework::ShowViewportSearchResults(bool clear, booking::filter::Types types,
|
||||
search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end)
|
||||
void Framework::ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear,
|
||||
booking::filter::Types types)
|
||||
{
|
||||
using booking::filter::Type;
|
||||
using booking::filter::CachedResults;
|
||||
|
@ -3165,7 +3167,8 @@ void Framework::ShowViewportSearchResults(bool clear, booking::filter::Types typ
|
|||
}
|
||||
};
|
||||
|
||||
FillSearchResultsMarks(clear, results.begin(), results.end(), postProcessing);
|
||||
FillSearchResultsMarks(results.begin(), results.end(), clear,
|
||||
postProcessing);
|
||||
};
|
||||
|
||||
m_bookingFilterProcessor.GetFeaturesFromCache(types, results, fillCallback);
|
||||
|
@ -3462,10 +3465,10 @@ void Framework::FilterResultsForHotelsQuery(booking::filter::Tasks const & filte
|
|||
}
|
||||
};
|
||||
|
||||
tasksInternal.emplace_back(type, move(paramsInternal));
|
||||
tasksInternal.emplace_back(type, std::move(paramsInternal));
|
||||
}
|
||||
|
||||
m_bookingFilterProcessor.ApplyFilters(results, move(tasksInternal), filterTasks.GetMode());
|
||||
m_bookingFilterProcessor.ApplyFilters(results, std::move(tasksInternal), filterTasks.GetMode());
|
||||
}
|
||||
|
||||
void Framework::OnBookingFilterParamsUpdate(booking::filter::Tasks const & filterTasks)
|
||||
|
|
|
@ -342,11 +342,11 @@ public:
|
|||
// SearchAPI::Delegate overrides:
|
||||
void RunUITask(function<void()> fn) override;
|
||||
void SetSearchDisplacementModeEnabled(bool enabled) override;
|
||||
void ShowViewportSearchResults(bool clear, search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end) override;
|
||||
void ShowViewportSearchResults(bool clear, booking::filter::Types types,
|
||||
search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end) override;
|
||||
void ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear) override;
|
||||
void ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear,
|
||||
booking::filter::Types types) override;
|
||||
void ClearViewportSearchResults() override;
|
||||
boost::optional<m2::PointD> GetCurrentPosition() const override;
|
||||
bool ParseSearchQueryCommand(search::SearchParams const & params) override;
|
||||
|
@ -552,8 +552,8 @@ public:
|
|||
using SearchMarkPostProcessing = function<void(SearchMarkPoint & mark)>;
|
||||
|
||||
void FillSearchResultsMarks(bool clear, search::Results const & results);
|
||||
void FillSearchResultsMarks(bool clear, search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, SearchMarkPostProcessing fn = nullptr);
|
||||
void FillSearchResultsMarks(search::Results::ConstIter begin, search::Results::ConstIter end,
|
||||
bool clear, SearchMarkPostProcessing fn = nullptr);
|
||||
list<TSearchRequest> const & GetLastSearchQueries() const { return m_searchQuerySaver.Get(); }
|
||||
void SaveSearchQuery(TSearchRequest const & query) { m_searchQuerySaver.Add(query); }
|
||||
void ClearSearchHistory() { m_searchQuerySaver.Clear(); }
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include "testing/testing.hpp"
|
||||
|
||||
#include "map/viewport_search_callback.hpp"
|
||||
|
||||
#include "search/mode.hpp"
|
||||
#include "search/search_tests_support/helpers.hpp"
|
||||
#include "search/search_tests_support/test_results_matching.hpp"
|
||||
#include "search/search_tests_support/test_search_request.hpp"
|
||||
|
||||
#include "map/viewport_search_callback.hpp"
|
||||
|
||||
#include "base/macros.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
|
@ -41,16 +41,16 @@ public:
|
|||
|
||||
bool IsViewportSearchActive() const override { return true; }
|
||||
|
||||
void ShowViewportSearchResults(bool clear, Results::ConstIter begin,
|
||||
Results::ConstIter end) override
|
||||
void ShowViewportSearchResults(Results::ConstIter begin, Results::ConstIter end,
|
||||
bool clear) override
|
||||
{
|
||||
if (clear)
|
||||
m_stats.m_numShownResults = 0;
|
||||
m_stats.m_numShownResults += distance(begin, end);
|
||||
}
|
||||
|
||||
void ShowViewportSearchResults(bool clear, booking::filter::Types types,
|
||||
Results::ConstIter begin, Results::ConstIter end) override
|
||||
void ShowViewportSearchResults(Results::ConstIter begin, Results::ConstIter end,
|
||||
bool clear, booking::filter::Types types) override
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ UNIT_CLASS_TEST(TestMwmEnvironment, BookingFilter_ProcessorSmoke)
|
|||
|
||||
FilterProcessor processor(GetIndex(), GetApi());
|
||||
auto tasksCopy = tasks;
|
||||
processor.ApplyFilters(results, std::move(tasksCopy), ApplyMode::Independent);
|
||||
processor.ApplyFilters(results, std::move(tasksCopy), ApplicationMode::Independent);
|
||||
|
||||
testing::Wait();
|
||||
|
||||
|
@ -224,7 +224,7 @@ UNIT_CLASS_TEST(TestMwmEnvironment, BookingFilter_ProcessorSmoke)
|
|||
TEST_EQUAL(dealsResults[i].GetFeatureID(), expectedDealsResults[i].GetFeatureID(), ());
|
||||
}
|
||||
|
||||
processor.ApplyFilters(results, std::move(tasks), ApplyMode::Consecutive);
|
||||
processor.ApplyFilters(results, std::move(tasks), ApplicationMode::Consecutive);
|
||||
|
||||
testing::Wait();
|
||||
|
||||
|
|
|
@ -337,16 +337,16 @@ bool SearchAPI::IsViewportSearchActive() const
|
|||
return !m_searchIntents[static_cast<size_t>(Mode::Viewport)].m_params.m_query.empty();
|
||||
}
|
||||
|
||||
void SearchAPI::ShowViewportSearchResults(bool clear, Results::ConstIter begin,
|
||||
Results::ConstIter end)
|
||||
void SearchAPI::ShowViewportSearchResults(Results::ConstIter begin, Results::ConstIter end,
|
||||
bool clear)
|
||||
{
|
||||
return m_delegate.ShowViewportSearchResults(clear, begin, end);
|
||||
return m_delegate.ShowViewportSearchResults(begin, end, clear);
|
||||
}
|
||||
|
||||
void SearchAPI::ShowViewportSearchResults(bool clear, booking::filter::Types types,
|
||||
Results::ConstIter begin, Results::ConstIter end)
|
||||
void SearchAPI::ShowViewportSearchResults(Results::ConstIter begin, Results::ConstIter end,
|
||||
bool clear, booking::filter::Types types)
|
||||
{
|
||||
return m_delegate.ShowViewportSearchResults(clear, types, begin, end);
|
||||
return m_delegate.ShowViewportSearchResults(begin, end, clear, types);
|
||||
}
|
||||
|
||||
ProductInfo SearchAPI::GetProductInfo(Result const & result) const
|
||||
|
|
|
@ -53,14 +53,14 @@ public:
|
|||
|
||||
virtual void SetSearchDisplacementModeEnabled(bool /* enabled */) {}
|
||||
|
||||
virtual void ShowViewportSearchResults(bool clear, search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end)
|
||||
virtual void ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void ShowViewportSearchResults(bool clear, booking::filter::Types types,
|
||||
search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end)
|
||||
virtual void ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear,
|
||||
booking::filter::Types types)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -124,11 +124,11 @@ public:
|
|||
void RunUITask(std::function<void()> fn) override;
|
||||
void SetHotelDisplacementMode() override;
|
||||
bool IsViewportSearchActive() const override;
|
||||
void ShowViewportSearchResults(bool clear, search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end) override;
|
||||
void ShowViewportSearchResults(bool clear, booking::filter::Types types,
|
||||
search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end) override;
|
||||
void ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear) override;
|
||||
void ShowViewportSearchResults(search::Results::ConstIter begin,
|
||||
search::Results::ConstIter end, bool clear,
|
||||
booking::filter::Types types) override;
|
||||
search::ProductInfo GetProductInfo(search::Result const & result) const override;
|
||||
void FilterResultsForHotelsQuery(booking::filter::Tasks const & filterTasks,
|
||||
search::Results const & results, bool inViewport) override;
|
||||
|
|
|
@ -17,10 +17,10 @@ booking::filter::Types FillBookingFilterTypes(search::Results const & results,
|
|||
{
|
||||
case Type::Deals:
|
||||
if (results.GetType() == search::Results::Type::Hotels)
|
||||
types.push_back(Type::Deals);
|
||||
types.emplace_back(Type::Deals);
|
||||
break;
|
||||
case Type::Availability:
|
||||
types.push_back(Type::Availability);
|
||||
types.emplace_back(Type::Availability);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -80,13 +80,13 @@ void ViewportSearchCallback::operator()(Results const & results)
|
|||
|
||||
if (types.empty())
|
||||
{
|
||||
delegate.ShowViewportSearchResults(firstCall, results.begin() + lastResultsSize,
|
||||
results.end());
|
||||
delegate.ShowViewportSearchResults(results.begin() + lastResultsSize, results.end(),
|
||||
firstCall);
|
||||
}
|
||||
else
|
||||
{
|
||||
delegate.ShowViewportSearchResults(firstCall, types, results.begin() + lastResultsSize,
|
||||
results.end());
|
||||
delegate.ShowViewportSearchResults(results.begin() + lastResultsSize, results.end(),
|
||||
firstCall, types);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -24,10 +24,10 @@ public:
|
|||
virtual void RunUITask(std::function<void()> fn) = 0;
|
||||
virtual void SetHotelDisplacementMode() = 0;
|
||||
virtual bool IsViewportSearchActive() const = 0;
|
||||
virtual void ShowViewportSearchResults(bool clear, Results::ConstIter begin,
|
||||
Results::ConstIter end) = 0;
|
||||
virtual void ShowViewportSearchResults(bool clear, booking::filter::Types types,
|
||||
Results::ConstIter begin, Results::ConstIter end) = 0;
|
||||
virtual void ShowViewportSearchResults(Results::ConstIter begin, Results::ConstIter end,
|
||||
bool clear) = 0;
|
||||
virtual void ShowViewportSearchResults(Results::ConstIter begin, Results::ConstIter end,
|
||||
bool clear, booking::filter::Types types) = 0;
|
||||
virtual void FilterResultsForHotelsQuery(booking::filter::Tasks const & filterTasks,
|
||||
search::Results const & results, bool inViewport) = 0;
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace search
|
|||
bool HotelsClassifier::IsHotelResults(Results const & results)
|
||||
{
|
||||
HotelsClassifier classifier;
|
||||
for ( auto const & r : results)
|
||||
for (auto const & r : results)
|
||||
classifier.Add(r);
|
||||
|
||||
return classifier.IsHotelResults();
|
||||
|
@ -18,7 +18,9 @@ bool HotelsClassifier::IsHotelResults(Results const & results)
|
|||
|
||||
void HotelsClassifier::Add(Result const & result)
|
||||
{
|
||||
m_numHotels += result.m_metadata.m_isHotel;
|
||||
if (result.m_metadata.m_isHotel)
|
||||
++m_numHotels;
|
||||
|
||||
++m_numResults;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include "search/bookmarks/results.hpp"
|
||||
#include "search/hotels_classifier.hpp"
|
||||
#include "search/ranking_info.hpp"
|
||||
|
|
|
@ -259,7 +259,8 @@ void SampleView::ShowNonFoundResults(std::vector<search::Sample::Result> const &
|
|||
|
||||
void SampleView::ShowFoundResultsMarks(search::Results::ConstIter begin, search::Results::ConstIter end)
|
||||
{
|
||||
m_framework.FillSearchResultsMarks(false /* clear */, begin, end);
|
||||
m_framework.FillSearchResultsMarks(begin, end, false,
|
||||
Framework::SearchMarkPostProcessing());
|
||||
}
|
||||
|
||||
void SampleView::ShowNonFoundResultsMarks(std::vector<search::Sample::Result> const & results,
|
||||
|
|
Loading…
Add table
Reference in a new issue