1c accounting 8.3 search does not work. Special operators allowed when specifying a search expression

Full-text search mechanism in 1C allows you to quickly find the information the user needs. This type search is especially effective if the information base has a large amount of information, and it is also not known exactly where the data of interest to the user is located or, as often happens, its exact name is not known. In order to open the full-text search control window, you must do the following: menu item Operations Full text search management .

In this window you can see three buttons: Settings - Enable/Disable full text search;

Update index Index creation/Index update; Clear index – resetting the index (recommended after updating all data); paragraph Allow index merging is responsible for merging the main and secondary index.

Full-text search is carried out using a full-text index. Without an index, full-text search as such is not possible. For a search to be effective, all relevant data must be included in the full-text index. If the user enters new data into the database, it must be included in the index in question, otherwise it will not participate in the search. To avoid this, you need to update the full-text index. When updating, the system analyzes only certain types of data: String, Reference type data (links to documents, reference books), Number, Date, StorageValues. If the user does not have access rights to certain information, then he will not be able to see it in the search results. You should also remember that in the properties of the objects for which the search will take place the value must be set Full Text Search – Use, which is set by default.

How can you notice the property Use set for the entire directory Reg Numbers , but this can be done for each of its attributes of the corresponding type.

Let's take a closer look at the full-text index, which consists of two parts (indexes): main index and additional . High speed Data retrieval is provided by the main index, but updating it is relatively slow, depending on the volume of data. The additional index is the opposite of it. Data is added to it much faster, but searching is slower. The system searches both indexes simultaneously. Most of the data is in the main index, and data added to the system goes into the additional index. While the amount of data in the additional index is small, searching through it is relatively fast. At a time when the system load is light, an index merge operation occurs, as a result of which the additional index is cleared and all data is placed in the main index. It is preferable to perform index merging at a time when the system load is minimal. For this purpose, you can create regulated tasks and scheduled tasks.

Consider the case automatic update index when the application starts. This case is suitable for single-user databases (such products as 1C Accounting Basic, 1C Simplified), since if there are a large number of users, the update will occur after each user has launched the application, which will result in a very strong impact on system performance.

First, let's create a general module and call it, for example PP. We will write down the following procedure:

Procedure UpdateIndices() Export

FulltextSearch.UpdateIndex();

End of Procedure

Let's also set the properties as in the figure.

Then right-click on the configuration name in the configuration tree and execute the command Open the managed application module. Select a predefined function in the small window above Before Starting the System and put the following line into this procedure:

UpdateFullTextSearch.UpdateIndexes();


Save the changes made. This way, after each application launch, the index will be updated automatically.

Now let's consider the case when there are several users. Here we will use Regular Tasks ( in Configurator mode: in the configuration tree – General – Regular Tasks). In this case, we are interested in only two tasks: Updating the Full-Text Search Index and merging the Full-Text Search Index. In the properties of these tasks, select Schedule and click on the link Open.

We configure schedules for both tasks. There are no recommendations for settings in this case; here the settings are determined based on the characteristics of the system (load, volume of information, frequency of its updates, etc.). The tasks themselves will not work; we will need to have a running program session in the mode Enterprises, who will be responsible for completing these tasks. It should immediately be noted that this work option is used for file system. This session must be running a wait handler that makes a built-in language method call. This processing will look like this:

Let's switch to Enterprise mode and do the following: Let's launch our processing, which in this case will be called every 5 seconds and, in turn, calls the “RunTaskProcessing()” method. This method checks whether it is time to complete tasks according to their schedule. Next, go to the menu item Operations – Constants – Program settings – Data Exchange tab.

Let's define a user session that will be responsible for execution and set the polling interval for routine tasks. It is not recommended to work in this session, as it may affect system performance. Also on ITS disks there is processing “ Running Routine Tasks”, which forcibly runs routine tasks at the user’s choice. The form of this processing is as follows:

Thus, all the preparatory work has been completed and you can proceed directly to the data search itself.

To start working with full-text search, you need to run the following command: menu Service à Data Search.

Then the following window will appear:

Clicking the button Settings, a field will appear with additional settings, such as: Limiting the search area, Fuzzy, Serving Size(in this case, value = 5, which means displaying five search results per page). Parameter Fuzzy indicates a discrepancy between some of the characters in the search query and the information obtained during the search. Fuzzy is specified as a percentage.

Full text search can use the following operators:

In addition, the full-text search mechanism allows writing part of the characters of a Russian word in single-key Latin characters. The search result will not change.

In the client-server version, the job scheduler is responsible for scheduling tasks.

The task scheduler is the active component of the server, i.e. Regardless of the presence of client connections to the server, it can perform routine tasks. The activity of the scheduler is especially noticeable when it sequentially queries all information bases for the presence of scheduled tasks in them. The scheduler can delay polling for a specific information base, if the information base is blocked from connecting or blocking routine tasks.

The current list of scheduled tasks in the scheduler can change automatically (for example, when a new scheduled task is created or an existing scheduled task is deleted). In any case, the task mechanism ensures that the list of scheduled tasks of the scheduler is up-to-date and corresponds to the lists of routine tasks of the cluster information bases.

After the initial list of scheduled jobs is successfully received, the scheduler periodically checks to see if any background job requests have been received and if any scheduled jobs need to be executed according to their schedule. After a job is received by a worker process, the worker process establishes a connection to the infobase and executes the job within that connection. Since the workflow is optimized for multi-user work, only the first creation of a connection to the infobase is a costly operation. Establishing subsequent connections to the same information base takes significantly less time and resources, because Most internal data structures are shared between connections within the same infobase. After the job completes, the worker process notifies the scheduler whether the job completed successfully or unsuccessfully. In the event of a software failure, the scheduler can restart the scheduled task (if the failure occurred while executing background job, then it will not be restarted).

Thank you!

Full text search- will allow you to find text information, placed almost anywhere in the configuration used. In this case, you can search for the necessary data either throughout the entire configuration as a whole, or by narrowing the search area to several objects (for example, certain types of documents or directories). The search criteria themselves can vary over a fairly wide range. That is, you can find the necessary data without even remembering exactly where it is stored in the configuration and how exactly it was recorded.

Full text search provides the following options:

  • There is support for transliteration (writing Russian words using Latin characters in accordance with GOST 7.79-2000). Example: "Russian phrase" = "russkaya fraza".
  • There is support for substitution (writing part of the characters in Russian words with single-key Latin characters). Example: “russrfz frapf” (the endings of each word are typed in Latin letters, for example, as a result of an operator error).
  • There is a possibility of fuzzy search (the letters in the found words may differ) with indication of the fuzzy threshold. Example: by specifying the word “hello” in the search bar and a vagueness of 17%, we will find all similar words with and without errors: “hello”, “prevet”, “prived”.
  • It is possible to specify the scope of the search for selected metadata objects.
  • Full-text indexing of standard field names ("Code", "Name", etc.) is carried out in all configuration languages.
  • The search is performed taking into account synonyms of Russian, English and Ukrainian languages.
  • The morphological dictionary of the Russian language contains a number of specific words related to areas of activity that are automated using the 1C:Enterprise program system.
  • As a standard, the supplied dictionaries include dictionary databases and dictionaries of thesaurus and synonyms of Russian, Ukrainian and English languages, which are provided by the Informatic company.
  • The search can be carried out using wildcard characters ("*"), as well as specifying search operators ("AND", "OR", "NOT", "NEXT") and special characters.

Full-text search can be carried out in any configuration on the 1C:Enterprise 8 platform

To open the full-text search control window, do the following:

Regular application- menu item Operations - Managing Full Text Search.

Managed Application- menu item Main menu - All functions - Standard -Full text search management.


  • Update index– Index creation/Index update;
  • Clear index– resetting the index (recommended after updating all data);
  • item Allow index merging– is responsible for merging the main and additional index.

Full-text search is carried out using a full-text index. Without an index, full-text search as such is not possible. For a search to be effective, all relevant data must be included in the full-text index. If the user enters new data into the database, it must be included in the index in question, otherwise it will not participate in the search. To avoid this, you need to update the full-text index. When updating, the system analyzes only certain types of data: String, Reference type data (links to documents, directories), Number, Date, Value Storage. If the user does not have access rights to certain information, then he will not be able to see it in the search results. You should also remember that in the properties of the objects for which the search will take place the value must be set Full Text Search – Use, which is set by default.

How can you notice the property Use set for the entire directory Counterparties, but this can be done for each of its attributes of the corresponding type.

Let's take a closer look at the full-text index, which consists of two parts (indexes): the main index and the additional one. High data retrieval speed is ensured by the main index, but updating it is relatively slow, depending on the volume of data. The additional index is the opposite of it. Data is added to it much faster, but searching is slower. The system searches both indexes simultaneously. Most of the data is in the main index, and data added to the system goes into the additional index. While the amount of data in the additional index is small, searching through it is relatively fast. At a time when the system load is light, an index merge operation occurs, as a result of which the additional index is cleared and all data is placed in the main index. It is preferable to perform index merging at a time when the system load is minimal. For this purpose, you can create regulated tasks and scheduled tasks.

Special operators allowed when specifying a search expression

The full-text search mechanism allows writing part of the characters of a Russian word using single-key Latin characters. The search result will not change.

Two operators NEXT

  • simplified. 8 words apart
  • NEAR/[+/-]n – search for data in one attribute at a distance of n-1 words between them.

The sign indicates in which direction from the first word the second word will be searched. (+ - after, - before)

The wildcard "*" can only be used as a substitute for the end of a word

Fuzziness operator "#". If the exact spelling of the name, name is unknown.

Software and 1C tools: programming.

Synonym operator "!" Allows you to find a word and its synonyms

How to programmatically update a full text search index?

Code 1C v 8.x Procedure UpdateIndices() Export
FulltextSearch.UpdateIndex();
End of Procedure

Full text data search example

Defining the SearchList Variable

Code 1C v 8.x Variable Search List;

In addition, in the procedure for processing the When Form Opens event, we will determine that this variable will contain a full-text search list, with the help of which we will search the data

Code 1C v 8.x Procedure OnOpen()
SearchList = FullTextSearch.CreateList();
End of Procedure

Now, for the event of clicking on the Find button, we will write code that will allow us to perform a search in accordance with the expression specified in the SearchExpression field

Code 1C v 8.x Procedure FindClick(Element)
SearchList.SearchString = SearchExpression;
Attempt
SearchList.FirstPart();
Exception
Warning(ErrorDescription());
EndAttempt;
If SearchList.FullQuantity() = 0 Then
Form Elements.ResultMessage.Value = "Not found";
Form Elements.Search Result.SetText("");
Otherwise
OutputSearchResult();
endIf;
End of Procedure

First in this procedure, we set the search term entered by the user as the search string for full-text search. Then we execute the FirstPart() method, which actually launches a full-text search and returns the first portion of results. By default, a chunk contains 20 elements. After that, we analyze the number of elements in the search list. If it does not contain any element, then we display a corresponding message in the form. Otherwise, the DisplaySearchResult() procedure is called, which displays the results to the user.

Let's create a procedure with the same name in the form module and write the code in it:

Code 1C v 8.x Procedure OutputSearchResult()
Form Elements.ResultMessage.Value = "Showing" + Row(SearchList.InitialPosition() + 1) + " - " + Row(SearchList.InitialPosition() +SearchList.Quantity()) + " from " + SearchList.FullQuantity();
Result = SearchList.GetDisplay(FullTextSearchDisplayType.HTMLText);
FormElements.SearchResult.SetText(Result);
ButtonAvailability();
End of Procedure

The steps in this procedure are simple. First, we generate a message about which elements are displayed and how many total elements were found. Then we get the result of the full-text search in the form of HTML text and display this text in the HTML document field located in the form.

Finally, we transfer control to the Button Availability() procedure in order to make available or, conversely, deny access to the Previous Portion and Next Portion buttons (depending on which portion of the results obtained is displayed). The text of this procedure is presented in the Code

Code 1C v 8.x Procedure Button Availability ()
Form Elements.NextPosition.Availability = (SearchList.FullQuantity() - SearchList.StartPosition()) > SearchList.Quantity();
Form Elements.PreviousPosition.Availability = (SearchList.StartPosition() > 0);
End of Procedure

Now you need to create event handlers for clicking on the PreviousPart() and NextPart() buttons.

Code 1C v 8.x Procedure Previous Portion Pressing (Element)
SearchList.PreviousPart();
OutputSearchResult();
End of Procedure
Procedure Next Portion Pressing (Element)
SearchList.NextPart();
OutputSearchResult();
End of Procedure

The final “touch” is to create a handler for the onclick event of the HTML document field located in the form. The fact is that the result of a full-text search, presented in the form of HTML text, contains hyperlinks to the numbers of elements of the search list. And we would like that when the user clicks on this link, the system would open the form of the object that is contained in this list element. To do this, we will intercept the onclick event of the HTML document contained in the HTML document field, get the list item number from the hyperlink and open the form of the corresponding object. The text of the onclick event handler of an HTML document field is presented in code

Code 1C v 8.x Procedure Search Resultonclick(Element, pEvtObj)
htmlElement = pEvtObj.srcElement;
// Check element id
If (htmlElement.id = "FullTextSearchListItem") Then
// Get the file name (search list line number),
// contained in the hyperlink
NumberInList = Number(htmlElement.nameProp);
// Get the search list string by number
SelectedRow = SearchList[NumberInList];
// Open the form of the found object
OpenValue(SelectedRow.Value);
pEvtObj.returnValue = False;
endIf;
End of Procedure

Tip1: Disable full text search*

Most accountants do not know about the existence of this function and never use it (Service - Data Search)

The full-text search mechanism in 1C allows you to find information in 1C by keywords(similar to searching on the Internet, when you enter a word and you are given query results). In this case, the search time significantly depends on the volume of the database and can take several hours. Disabling the full-text search mechanism does not affect other functions and stability of work in 1C.

The full-text search mechanism in 1C is enabled by default. To disable full text search, you need to go to Operations - Full text search management-Setting and removing the sign " Allow full text search»

Disabling the full-text search mechanism is carried out in exclusive mode (no one should work in the program except you)**

Disabling the full-text search engine increases performance by up to 10%.

Tip2: Recalculation of results*

Most accountants do not know about the existence of this operation, and it must be performed every month.

The results are 1C mechanisms for quick access to data when generating reports and performing various computational operations.

In order to recalculate the totals, you need to go to Operations - Totals Management, set the date by which to calculate the totals (the beginning of the current month) in the “All registers” section and click the “Run” button

Recalculation of results is carried out in exclusive mode (no one should work in the program except you)**

Recalculation of the results gives an increase in productivity of up to 10%.

Tip3: Disable object versioning***

Most accountants do not know about the existence of this function and do not use it.

Unlike a standard log, versioning objects will allow you to store information not only about which user worked with the document, but also what exactly he changed (Service - History of object changes). This mode can be useful, but it is recommended to enable it only for a specific list of documents, because it leads to a decrease in 1C performance and an increase in the information base

Versioning is configured through Operations - Program Settings - Versioning. If the setting is not required, then you need to remove the “Use object versioning” checkbox.

If the setting is needed for a specific list of documents, then go to “Object versioning settings” and right-click to set the “Version” setting for the required objects**

Disabling versioning gives a performance increase of up to 5%.

_________________________________________________________________

*For configurations based on “1C: Industrial Enterprise Management”, “1C: Integrated Automation”, “1C: Enterprise Accounting 2.0”, “1C: Trade Management 10.3”

**Before performing routine operations with the database, it is necessary to create a copy of the database.

***For configurations based on “1C: Manufacturing Enterprise Management”, “1C: Integrated Automation”.

In the latest editions of the configuration based on 1C 8.3, an excellent opportunity has appeared to automate the search and replacement of duplicate directories. This is done using special processing 1C - Search and replacement of duplicates. It is built into such application solutions on managed forms as: , .

Let's look at a short instruction: how to find processing in the interface, how to use it to collapse duplicate items of items, contractors and other directories.

Attention! Before working with processing, be sure to do backup copy Database.

Processing to find duplicates

Processing Search and removal of duplicates is located on the “Administration” tab, in the “Support and Maintenance” section:

At the bottom:

Get 267 video lessons on 1C for free:

During processing, it is necessary to indicate which directory we want to “scan” (in our case, nomenclature), according to which selection (those not marked for deletion) and what will be a fact of a duplicate for us (let’s take a name match for similar words). After setting, click “Find duplicates”.

1C will offer options for duplicates:

Using the example of the STINOL refrigerator: the system marked the element with the ending “101” as the original, and the element “103” as a duplicate. In the window on the right we see in which documents this item is involved.

You can repurpose the "original" using the "Mark as original" button based on your beliefs. I recommend choosing as a standard the object that has more “use points” in order to speed up the process of gluing takes:

In 1C 8.2, the search and removal of duplicate elements was carried out using universal processing from the ITS disk: Search and replace data (8.2), which made it possible to replace values. Next, objects without links were marked for deletion and eliminated using the Deletion of marked objects processing.

The process of searching and deleting duplicates in 1C 8.2 was carried out in separate operations:

  • The presence of a duplicate in the database was recorded;
  • The largest number of links to the found pair was determined;
  • Processing Find and replace data an object with fewer links was replaced by a found duplicate with a larger number of links;
  • The object to which references were replaced was marked for deletion. Further processing was removed from the 1C 8.2 database.

Finding and deleting duplicates in 1C 8.3

The 1C 8.3 database implements a unique mechanism for searching and removing duplicates in the form of a standard processing of the same name. It searches for duplicate elements both in contractors and items, as well as in other documents and directories.

Typical processing in 1C 8.3 Finding and removing duplicates facilitates the process of removing unnecessary information from 1C 8.3. Moreover, deletion without errors, that is, without violations of accounting in the database! We'll look at how to apply processing step by step below.

Step 1. Where is the search and removal of duplicates processing located?

Processing in 1C 8.3 can be easily called:

  • Ch. menu – All functions – Processing – Search and delete duplicates:
  • Section Administration – Support and Maintenance:

  • Setting up the navigation panel of the Administration section – selecting the Search and remove duplicates command:


Step 2. Processing capabilities “Search and remove duplicates”

What do you need to know and what is this treatment intended for?

  • Processing searches for and eliminates duplicate elements in all lists of the 1C 8.3 database. At the same time, for administrators 1C 8.3 must be installed full rights;
  • Processing helps to find occurrences of all duplicated elements in the 1C 8.3 database and replaces duplicates with links to the selected “correct” element.

Step 3. Find duplicate elements

Calling the processing form Finding and removing duplicates. The sequence of actions is indicated by numbers in circles:

We define the conditions for selecting search elements:

  1. Selecting documents or directories in which processing will search for duplicates;
  2. Imposing selection conditions for selecting elements. For example, to delete an unmarked, filled-in TIN details:

  1. As a rule, in 1C 8.3 the default names are set to match, but it is possible to set others. For example, if the TIN matches in 1C 8.3, there will be a warning about the presence of an existing TIN in the database. Coincidence of codes due to the built-in uniqueness of numbers in 1C is almost impossible. Therefore, the default option is the most popular:

By pressing the button. Search for duplicates Data is selected and compared according to established conditions. If no duplicate elements are found, a message appears:

When duplicates are detected, a list of duplicates appears. The list includes:

  • On the left are the found elements;
  • On the right is data on the elements: the number of duplicates found and the list of documents in which they were used.

Step 4: Select the original

One of the elements on the left side is automatically set as the original. In this case, you can specify another element by selecting it and clicking Mark as original. In the list, duplicates are marked with flags.

Step 5. Removing duplicates in 1C 8.3

Produced according to the book. Remove duplicates. Duplicates are marked for deletion, and all their attachments in documents are replaced with the selected original. Duplicate elements can be completely removed by processing Removing marked objects. Section Administration – Support and Maintenance.

So, all the information on processing has been received, let’s move on to practice.

Step 6. Example of removing duplicates in the Bank Accounts directory

Let's create the Search and remove duplicates form:

  1. Directory of bank accounts;
  2. Not marked for deletion;
  3. Compare by name.

For example, the 1C 8.3 database contains duplicate bank accounts. Let's look at how processing will remove duplicate links:

Click Find duplicates. As a result, 1C 8.3 identified all three duplicate elements and makes it possible to leave the object with more links. This makes sense, so we do this:

Press the button Remove duplicates. After completing all necessary actions in 1C 8.3 the corresponding message appears:

Let's check the Bank Accounts directory. As a result, two accounts are marked for deletion:

Everything went well. Our 1C 8.3 database is in order!

Be careful! Need to do reservevnuyu toI'm drinking before deleting duplicates, since the procedure is not reversible! Once you have finished removing duplicate elements, perform Testing and Correction of the database, check the main reports, etc.

How to merge duplicated data in the 1C ZUP 8.3 program individuals with the help of a special assistant, watch in our video.