Answer the question
In order to leave comments, you need to log in
What is the principle of creating a live search by infoblock elements for Bitrix?
It is necessary to make a live search for the elements of the infoblock in Bitrix. There is a form in which there is a select field. The data in the select must be loaded dynamically from the infoblock. The infoblock has about 10,000 elements. The bootstrap-select plugin is used as a plugin to change the select view . The user enters a phrase in the select, then the list of found dynamically should be loaded. There are other fields in the form that should also be saved along with the select. Select can be multiple in the form (this is important).
I assume that you need to make a request through Jquery to the desired file. The file must contain CIBlockElement::GetList. Depending on the search phrase, the option fields in the select should change. With the help of Jquery, you need to make a request to the file and in the option output (insert into select via the selector) the list of found elements in the infoblock (CIBlockElement::GetList).
Questions:
Answer the question
In order to leave comments, you need to log in
1. Create a file like "/api/[something].list.php"
2. In it, describe the logic of work (CIBlockElement and that's it).
3. In the form, make a request to this file
. Actually, this will be enough.
I do not advise you to make some kind of general service, such as "iblock.list", since passing request parameters like "IBLOCK_ID", "ID", ... in the clear is not cool at all. Of course, you can pre-encrypt data (for example, AES), but do you need this hemorrhoids?
Concerning productivity: do search in a substring (normal LIKE). If it takes too long, you can create a full-text index on the field ( www.mysql.ru/docs/man/Fulltext_Search.html ) or make a regular index and search by the initial string, i.e. LIKE"
I would take the bitrix:search.title component as a basis and redesign its template.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question