A
A
Alexey2018-03-25 22:30:43
1C-Bitrix
Alexey, 2018-03-25 22:30:43

How to search by section properties (UF) of type "File"?

Good day.
Tell me, please, how to solve the problem from the subject?
There is an infoblock, sections are created in it (there are no elements), sections have the "Information" property - type "File", multiple.
I need to do a search by the name of the file that is attached in this property.
The "Field values ​​are included in the search" checkbox is on, but there is no result in the search and there is nothing in the b_search_content table either.
Those. I enter "OFFER AGREEMENT" into the search and I want to see as a result at least the page of the section where this file is located, as a maximum a link to this file.
I found a topic on the toaster - How to set up a search by the description of the property of an element of type file? , you need to do something similar or there are other solutions, native for example :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2018-03-26
@Pentblch

Your task is not solved out of the box - only certain fields of the element itself (for example, the text of the announcement, the text of the full news) and the values ​​(!) of custom fields get into the search index.
For a field of type file, the value of the custom field is not the name, but the content (and then, if the appropriate handle to open the file is found).
But your problem can be solved technically:
1) On events before adding/changing the infoblock element in SEARCH_CONTENT, you can add the file name
2) Then subscribe to indexing events and add the corresponding values ​​to the search.
As an example, you can see https://dev.1c-bitrix.ru/community/blogs/oracle/26...
For example, you can also develop a separate page for a more optimal search (at the last conference, Vadim Dumbravanu talked about full-text search in his developments for a little over an hour)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question