<commit_before><?php

use \CultuurNet\Search\Parameter;
use \CultuurNet\Search\Component\Facet\FacetComponent;

/**
 * @file
 * Base class for search pages.
 */
class CultureFeedSearchPage {

  /**
   * Constants to define the available pager types.
   */
  const PAGER_NORMAL = 0;
  const PAGER_INFINITE_SCROLL = 1;

  /**
   * Current page number that is shown.
   */
  protected $pageNumber = 1;

  /**
   * Start index from items currently shown.
   * @var int
   */
  protected $start = 0;

  /**
   * Total results per page.
   * @var int
   */
  protected $resultsPerPage = 10;

  /**
   * Indicator whether to render the full page or only the list items.
   * E.g. for ajax requests.
   * @var Boolean
   */
  protected $fullPage = TRUE;

  /**
   * Pager type to render with this page.
   * @var Int
   */
  protected $pagerType = self::PAGER_NORMAL;

  /**
   * Default sort key.
   * @var String
   */
  protected $defaultSortKey = \CultuurNet\Search\ActivityStatsExtendedEntity::ACTIVITY_COUNT_PAGE_FOLLOW;

  /**
   * List of input parameters to be given to the search.
   * @var \CultuurNet\Search\Parameter\AbstractParameter[]
   */
  protected $parameters = array();

  /**
   * The group value to send to the service.
   * @var string|boolean
   */
  protected $group = TRUE;

  /**
   * Query to search on.
   * @var array
   *   An array containing search strings. The respective values will be treated
   *   as required search terms, joined with "AND". If a single value contains
   *   multiple words separated by spaces, these will be treated as "AND".
   */
  protected $query = array();

  /**
   * Apache Solr local parameters.
   *
   * @see http://wiki.apache.org/solr/LocalParams
   *
   * @var array
   *   An array containing Apache Solr local parameters as key-value pairs.
   */
  protected $localParams = array();

  /**
   * Search result from current search.
   * @var \CultuurNet\Search\SearchResult
   */
  protected $result;

  /**
   * Default page title. This is a fallback in case no other title is provided.
   * @var string
   */
  protected $defaultTitle = '';

  /**
   * The page title to use. If empty this will be overridden by $defaultTitle.
   * @var string
   */
  protected $title = '';

  /**
   * Stores search facets with corresponding values for the active search.
   * @var \CultuurNet\Search\Component\Facet\FacetComponent
   */
  protected $facetComponent;

  /**
   * Gets the default sortkey.
   * @return String $sortKey
   */
  public function getDefaultSort() {
    return $this->defaultSortKey;
  }

  /**
   * Gets the search facets.<commit_msg>Hotfix: Also add the exception as property<commit_after><?php

use \CultuurNet\Search\Parameter;
use \CultuurNet\Search\Component\Facet\FacetComponent;

/**
 * @file
 * Base class for search pages.
 */
class CultureFeedSearchPage {

  /**
   * Constants to define the available pager types.
   */
  const PAGER_NORMAL = 0;
  const PAGER_INFINITE_SCROLL = 1;

  /**
   * Current page number that is shown.
   */
  protected $pageNumber = 1;

  /**
   * Start index from items currently shown.
   * @var int
   */
  protected $start = 0;

  /**
   * Total results per page.
   * @var int
   */
  protected $resultsPerPage = 10;

  /**
   * Indicator whether to render the full page or only the list items.
   * E.g. for ajax requests.
   * @var Boolean
   */
  protected $fullPage = TRUE;

  /**
   * Pager type to render with this page.
   * @var Int
   */
  protected $pagerType = self::PAGER_NORMAL;

  /**
   * Default sort key.
   * @var String
   */
  protected $defaultSortKey = \CultuurNet\Search\ActivityStatsExtendedEntity::ACTIVITY_COUNT_PAGE_FOLLOW;

  /**
   * List of input parameters to be given to the search.
   * @var \CultuurNet\Search\Parameter\AbstractParameter[]
   */
  protected $parameters = array();

  /**
   * The group value to send to the service.
   * @var string|boolean
   */
  protected $group = TRUE;

  /**
   * Query to search on.
   * @var array
   *   An array containing search strings. The respective values will be treated
   *   as required search terms, joined with "AND". If a single value contains
   *   multiple words separated by spaces, these will be treated as "AND".
   */
  protected $query = array();

  /**
   * Apache Solr local parameters.
   *
   * @see http://wiki.apache.org/solr/LocalParams
   *
   * @var array
   *   An array containing Apache Solr local parameters as key-value pairs.
   */
  protected $localParams = array();

  /**
   * Search result from current search.
   * @var \CultuurNet\Search\SearchResult
   */
  protected $result;

  /**
   * Default page title. This is a fallback in case no other title is provided.
   * @var string
   */
  protected $defaultTitle = '';

  /**
   * The page title to use. If empty this will be overridden by $defaultTitle.
   * @var string
   */
  protected $title = '';

  /**
   * Stores search facets with corresponding values for the active search.
   * @var \CultuurNet\Search\Component\Facet\FacetComponent
   */
  protected $facetComponent;

  /**
   * Stores the exception that occurred when searching.
   */
  protected $exception;

  /**
   * Gets the default sortkey.
   * @return String $sortKey
   */
  public function getDefaultSort() {
    return $this->defaultSortKey;
  }

  /**
   * Gets the search facets.
{'fraction_non_alphanumeric': 0.10961466517022073, 'fraction_numerical': 0.002244668911335578, 'mean_word_length': 2.6398910823689583, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '254204', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1632, 'n_words': 538}