L
L
lexstile2018-04-24 14:26:12
1C-Bitrix
lexstile, 2018-04-24 14:26:12

How to limit the search in Bitrix only by elements, excluding sections?

$arElements = $APPLICATION->IncludeComponent(
        "bitrix:search.page", "catalog", Array(
    "RESTART" => $arParams["RESTART"],
    "NO_WORD_LOGIC" => $arParams["NO_WORD_LOGIC"],
    "USE_LANGUAGE_GUESS" => $arParams["USE_LANGUAGE_GUESS"],
    "CHECK_DATES" => $arParams["CHECK_DATES"],
    "arrFILTER" => array("iblock_" . $arParams["IBLOCK_TYPE"]),
    "arrFILTER_iblock_" . $arParams["IBLOCK_TYPE"] => array($arParams["IBLOCK_ID"]),
    "USE_TITLE_RANK" => "N",
    "DEFAULT_SORT" => "rank",
    "FILTER_NAME" => "",
    "SHOW_WHERE" => "N",
    "arrWHERE" => array(),
    "SHOW_WHEN" => "N",
    "PAGE_RESULT_COUNT" => $arParams["PAGE_RESULT_COUNT"],
    "DISPLAY_TOP_PAGER" => "N",
    "DISPLAY_BOTTOM_PAGER" => "N",
    "PAGER_TITLE" => "",
    "PAGER_SHOW_ALWAYS" => "N",
    "PAGER_TEMPLATE" => "N",
        ), $component, array('HIDE_ICONS' => 'Y')
);

Element and section id's come, example:
Array
(
    [6197] => S1076
    [6181] => S1024
    [7345] => S1237
    [6192] => S1067
    [7455] => S1158
    [8831] => 7386
    [8830] => 7385
    [8829] => 7384
    [8828] => 7383
................
)

Can this be done in a component call?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2018-04-24
@lexstile

In the infoblock settings, disable "Consider sections when searching"

A
Ainur Valiev, 2018-04-24
@vaajnur

yes, instead of the search component, you call bitrix.catalog with a filter

E
Evgeny Nikolaev, 2019-05-28
@nikolaevevge

When searching in Yandex, I came across this question, in fact, the answer to my question is in this section Bitrix search module. How to make the results show products if the searched item is included in the name of the section (section)? (I needed the search to go not only on information from the infoblog elements, but also to add the name of the sections in which they are located to the index of these elements).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question