<commit_before>#pragma once

#include "params.hpp"

#include "../geometry/rect2d.hpp"

#include "../coding/reader.hpp"

#include "../base/mutex.hpp"

#include "../std/scoped_ptr.hpp"
#include "../std/string.hpp"
#include "../std/function.hpp"


class Index;

namespace search
{

class Query;
class Results;

class EngineData;

class Engine
{
  typedef function<void (Results const &)> SearchCallbackT;

public:
  typedef Index IndexType;

  // Doesn't take ownership of @pIndex. Takes ownership of pCategories
  Engine(IndexType const * pIndex, Reader * pCategoriesR,
         ModelReaderPtr polyR, ModelReaderPtr countryR,
         string const & lang);
  ~Engine();

  void PrepareSearch(m2::RectD const & viewport,
                     bool hasPt, double lat, double lon);
  void Search(SearchParams const & params, m2::RectD const & viewport);

  string GetCountryFile(m2::PointD const & pt) const;
  string GetCountryCode(m2::PointD const & pt) const;

private:
  static const int RESULTS_COUNT = 10;

  void SetViewportAsync(m2::RectD const & viewport, m2::RectD const & nearby);
  void SearchAsync();

  threads::Mutex m_searchMutex, m_updateMutex, m_readyMutex;

  volatile bool m_readyThread;

  SearchParams m_params;
  m2::RectD m_viewport;

  Index const * m_pIndex;
  scoped_ptr<search::Query> m_pQuery;
  scoped_ptr<EngineData> m_pData;
};

}  // namespace search
<commit_msg>[search] New search constant for results count = 15.<commit_after>#pragma once

#include "params.hpp"

#include "../geometry/rect2d.hpp"

#include "../coding/reader.hpp"

#include "../base/mutex.hpp"

#include "../std/scoped_ptr.hpp"
#include "../std/string.hpp"
#include "../std/function.hpp"


class Index;

namespace search
{

class Query;
class Results;

class EngineData;

class Engine
{
  typedef function<void (Results const &)> SearchCallbackT;

public:
  typedef Index IndexType;

  // Doesn't take ownership of @pIndex. Takes ownership of pCategories
  Engine(IndexType const * pIndex, Reader * pCategoriesR,
         ModelReaderPtr polyR, ModelReaderPtr countryR,
         string const & lang);
  ~Engine();

  void PrepareSearch(m2::RectD const & viewport,
                     bool hasPt, double lat, double lon);
  void Search(SearchParams const & params, m2::RectD const & viewport);

  string GetCountryFile(m2::PointD const & pt) const;
  string GetCountryCode(m2::PointD const & pt) const;

private:
  static const int RESULTS_COUNT = 15;

  void SetViewportAsync(m2::RectD const & viewport, m2::RectD const & nearby);
  void SearchAsync();

  threads::Mutex m_searchMutex, m_updateMutex, m_readyMutex;

  volatile bool m_readyThread;

  SearchParams m_params;
  m2::RectD m_viewport;

  Index const * m_pIndex;
  scoped_ptr<search::Query> m_pQuery;
  scoped_ptr<EngineData> m_pData;
};

}  // namespace search

{'fraction_non_alphanumeric': 0.11422490244767648, 'fraction_numerical': 0.007804185881518269, 'mean_word_length': 4.01779359430605, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1274689', 'n_tokens_mistral': 937, 'n_tokens_neox': 903, 'n_words': 249}