Bitrix Site Manager

CSearcherHit::GetList

CDBResult
CSearcherHit::GetList(
 string &by = "s_date_hit",
 string &order = "desc",
 array filter = array(),
 bool &is_filtered
)

The method GetList returns a list of search engine hits.

Parameters

Parameter Description
by Sorting field; possible values:
  • s_id - the hit ID;
  • s_site_id - the site ID;
  • s_date_hit - the date the hit was made;
  • s_searcher_id - the search engine ID;
  • s_user_agent - the search engine UserAgent;
  • s_ip - the search engine IP address;
  • s_url - address of the indexed page.
order Sort order; the following values are possible:
  • asc - ascending;
  • desc - descending.
filter Array used to filter the resulting list. The following keys can be used in the array:
  • ID* - the hit ID;
  • ID_EXACT_MATCH - if "N", entry in the ID is sufficient (loose match);
  • SEARCHER_ID* - the search engine ID;
  • SEARCHER_ID_EXACT_MATCH - if "N", entry in the SEARCHER_ID is sufficient (loose match);
  • URL* - address of the indexed page;
  • URL_404 - indicates the error 404 occurred on the first page (Y|N);
  • SEARCHER* - name of the search engine;
  • SEARCHER_EXACT_MATCH - if "Y", the SEARCHER must match exactly (strict match);
  • DATE1 - the earliest date of the hit for which the information is to be returned;
  • DATE2 - the latest date of the hit for which the information is to be returned;
  • IP* - the search engine IP address;
  • IP_EXACT_MATCH - if "Y", the FIRST_PAGE must match exactly (strict match);
  • USER_AGENT* - the search engine UserAgent;
  • USER_AGENT_EXACT_MATCH - if "Y", the USER_AGENT must match exactly (strict match);
  • SITE_ID* - the site ID;
  • SITE_ID_EXACT_MATCH - if "Y", the SITE_ID must match exactly (strict match).
* - complex logic allowed.
is_filtered If this flag contains "true" on return, the resulting list is filtered.

Structure of the returned record

Array
(
    [ID] => the hit ID
    [DATE_HIT] => date of the hit
    [SEARCHER_ID] => the search engine ID
    [SEARCHER_NAME] => name of the search engine
    [URL] => address of the indexed page
    [URL_404] => [Y|N] indicates the error 404 occurred on the indexed page
    [IP] => the search engine IP address
    [USER_AGENT] => the search engine UserAgent
    [HIT_KEEP_DAYS] => days to keep hits of the search engine
    [SITE_ID] => the site ID
)

See Also

Example



<?
// we want pages indexed by search engines #20 and #21
$arFilter = array(
    "SEARCHER_ID" => "20 | 21"
    );

// obtain the list of records
$rs = CSearcherHit::GetList(
    ($by = "s_url"), 
    ($order = "desc"), 
    $arFilter, 
    $is_filtered
    );

// print all records
while ($ar = $rs->Fetch())
{
    echo "<pre>"; print_r($ar); echo "</pre>";    
}
?>