Database search examples
In 1C:Enterprise mode
The search based on the full-text index is a standard 1C:Enterprise platform feature.
- In the Tools pane, click the Search button (the one with the magnifying glass, fig. 19.7).
Fig. 19.7. Running the search
The amount of data in your database is small, still it is enough for studying the basic full-text search features.
- In the search field, enter Johnson.
In the search field, type Johnson and click Find (fig. 19.8).
Fig. 19.8. Search for "Johnson"
The search result contains 7 items. The words that match the search string are marked bold and green.
The search can return all word forms. Let us test this.
- Search for customers (fig. 19.9).
Fig. 19.9. Search for "customers"
Note that different forms of that word are found: "customer" and "customers".
To perform search by the exact phrase, enclose it in double quotation marks.
- Search for "customers" (fig. 19.10).
Fig. 19.10. Exact search for "customers"
Sometimes users do not remember the exact material or service names. In this case they have the option to search by the first characters of the word, with the rest of the characters replaced with asterisk (*).
- Search for tran* (fig. 19.11).
Fig. 19.11. Search for the first characters of a keyword
The search for tran* returns items that include transformers or transistors.
As a rule, using a couple of words gives the best result. For example, if you want to find the date when customer Smith had a transformer replaced in their TV, try "smith transformer".
- Search for smith transformer (fig. 19.12).
Fig. 19.12. Search for "smith transformer"
Clicking the hyperlink opens the Services #3 document, which contains the full list of services rendered to this customer.
The platform indexes not only the data stored in configuration objects, but also names of attributes and metadata objects. Therefore, if you want to search for Johnson employee, specify the appropriate catalog name or its part.
- Search for johnson employee (fig. 19.13).
Fig. 19.13. Search for "johnson employee"
As you can see, the platform found several items, including employee accrual documents, but the Employee catalog item is on top of the list.
The platform supports fuzzy search. If you are not sure about the spelling, you can enter number sign (#) followed by the number of characters that can be different. Let us try searching for repair records with incorrect spelling.
- Search for reepair#2 (fig. 19.14).
Fig. 19.14. Fuzzy search for "reepair"
Search by synonyms is also available. To use this option, precede the search string by exclamation mark (!). For example, search for !mending gives the same result as search for repair (see fig. 19.14) because they are synonyms.
The search supports a variety of operators, which are described in detail in appendix "Full-text search expressions" of 1C:Enterprise 8.3 Developer guide.
The search form that is displayed when you click the Find button (fig. 19.8-19.14) is generated by the platform. This is because the Default search form configuration property value is empty by default.
You can change the default search algorithm if needed by clicking the Open button in the property field. This opens the common form wizard, which generates the form that is opened by the platform when users run the search. You can change the form, and then the platform will open your version of that form.