Bitrix Site Manager

CSearcher::GetList

CDBResult
CSearcher::GetList(
 string &by = "s_today_hits",
 string &order = "desc",
 array filter = array(),
 bool &is_filtered,
 mixed limit = false
)

The method GetList returns a list of search engines and their number of hits (indexed pages): for the whole time of keeping statistics, for the last 3 days, or for the specified period.

Parameters

Parameter Description
by Sorting field. Possible values:
  • s_id - the search engine ID;
  • s_date_last - date of the last hit;
  • s_today_hits - today's hits;
  • s_yesterday_hits - yesterday's hits;
  • s_b_yesterday_hits - number of hits for day before yesterday;
  • s_total_hits - total hits;
  • s_period_hits - number of hits for the specified period (filter["DATE1"], filter["DATE2"]);
  • s_name - search engine name;
  • s_user_agent - the search engine UserAgent.
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 search engine ID;
  • ID_EXACT_MATCH - if "N", entry in the ID is sufficient (loose match);
  • ACTIVE - active state flag:
    • Y - active;
    • N - inactive.
  • SAVE_STATISTIC - flag: whether to save search engine hits or not (Y|N);
  • DIAGRAM_DEFAULT - flag: whether to include in graphs and charts by default (Y|N);
  • HITS1 - minimum hits to match against the field "number of hits";
  • HITS2 - maximum hits to match against the field "number of hits";
  • DATE1_PERIOD - the earliest date of an arbitrary period;
  • DATE2_PERIOD - the latest date of an arbitrary period;
  • DATE1 - the earliest date of the required search engine hits;
  • DATE2 - the latest date of the required search engine hits;
  • NAME* - search engine name;
  • NAME_EXACT_MATCH - if "Y", the NAME 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).
* - complex logic allowed.
is_filtered If this flag contains "true" on return, the resulting list is filtered.
limit Maximum number of search engines to return. If set to false, the number of search engines will be limited to that specified in the parameter Maximum number of records displayed in tables in the Statistics module settings.

Structure of the returned record

Array
(
    [ID] => the search engine ID
    [NAME] => name
    [USER_AGENT] => UserAgent
    [DIAGRAM_DEFAULT] => [Y|N] flag: whether to include in
                                     graphs and charts by default
    [DATE_LAST] => date of the last hit
    [TOTAL_HITS] => total hits
    [TODAY_HITS] => today's hits
    [YESTERDAY_HITS] => yesterday's hits
    [B_YESTERDAY_HITS] => number of hits for day before yesterday
    [PERIOD_HITS] => number of hits for the specified period 
                     (filter["DATE1_PERIOD"], filter["DATE2_PERIOD"])
)

See Also

Example



<?
// We want data on search engines #20 and #21
// also get additional information for December 2005
$arFilter = array(
    "ID"           => "20 | 21",
    "DATE1_PERIOD" => "01.12.2005",
    "DATE2_PERIOD" => "31.12.2005",
    );

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

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