The infobase of Jack of All Trades is very small for now. In the process of creating and testing the configuration you only added a few materials and services and posted a small number of documents.
But real-life infobases contain much more data and sometimes locating required data is a challenging task, especially for a user who is not deeply familiar with the products (services) or with the list of contractors.
To simplify the search for information in the database, 1C:Enterprise offers full-text search. The advantage of this search is the usage of simple and natural search queries, such as "peterson phone". You can also use operators similar to those used for Internet search (AND, OR, NOT, and so on).
The full-text search is handy when you do not know the exact location of the required data (for example, a specific catalog). Full-text search is absolutely vital when you do not know exactly what you need to search for (for example, you do not remember the exact name of a product or a contractor).
Besides, full-text search finds data where other search tools are very time-consuming or require creation of special algorithms and data processors. For example, full-text search works well with lengthy text fields and fields of the ValueStorage type.
In this lesson you will learn the basics of full-text search, create a full-text index, and use the search based on this index to find specific data in the Jack of All Trades database.
Full-text search in 1C:Enterprise is based on two components:
- Full-text index
- Full-text search tools
A full-text index is required for full-text search to be available. A full-text index is created once and then should be updated regularly.
The search only covers the data contained in the full-text index. So if a database is used heavily (data is modified, new data is added), the full-text index should be updated as frequently as possible. But if there are moderate volumes of modified or new data, full-text index can be updated less frequently, for example, once a day when the system experiences the least load.
A full-text index can be created and updated both interactively in 1C:Enterprise mode and using 1C:Enterprise script tools. In this lesson we will cover interactive indexing, while the next lesson will show how to update a full-text index automatically.
In a running infobase the platform tracks modifications of data in the configuration objects that can be included in the full-text search. Such objects include exchange plans, catalogs, documents, charts of characteristic types, charts of accounts, charts of calculation types, registers (information, accumulation, accounting, and calculation), business processes, and tasks.
When the full-text index is created or updated, the platform analyzes the data stored in attributes of such objects and includes this data in the index. Note that it is true only for some attributes: those of the Ref, Number, Date, and ValueStorage types, and those of referential type (for example, CatalogRef.Products).
The full-text search itself is performed using 1C:Enterprise script tools. Leaping ahead, we will note here that full-text search is performed in compliance with user rights. So if some data is not available to a specific user, this user cannot obtain this data using full-text search either.
The results of a full-text search are retrieved in batches and they are sorted in a specific order. This increases the chance to find the required data in the beginning of the first batch. In practice, when a search query is written well, the required data is retrieved in the top three to five results.
Now that you understand how full-text search works in general, let us proceed to the first part of the full-text search tutorial: the creation of a full-text index.
Then you will run the full-text search based on the created index.