Dynamics CRM, Search

Problems with the full-text search of dynamics 365

If you are using the full-text search, you may encounter some special behavior. Like adding an account named „STILL“. If you try to find the account with enabled full-text search, you won’t find it. With disabled full-text search, the account can be found with the quick find.

I was working with a Microsoft engineer on this case and we found the solution:

First I used the “sql profiler” to get the sql statement:

 

The statement looks good. So I check the catalog:

  1. Check the Full-Text Catalog:
    In order for the quick find to work, the tables for the entities that you have configured in CRM have to be present on the Full-Text Catalog:
    Check the Full-Text CatalogThen, to the Full text catalog General page and check on its status. It should be in “Idle”.
    Depending on the result of the status and the Last Population Date we need to see if we need to Rebuild the catalog or not.
  2. Check the Indexes that run in the quick find:The indexes that were already crawled and should be ready to be used in the Full-Text catalog and in the Quick find.
    This query is used to see if the indexes are ready.

    If the “has_crawl_completed” Column has the value (1=complete), it should be ready.
  3. Check if the indexes are being used:

    This query will let us see which indexes are being used by the Quick find. If the “State” column is at 2 they are being used.

All this was ok. So we checked the rebuild of the catalog:

Every time you activate “Quick Find”, this is what is happening in the background:

There are two maintenance jobs that are responsible for the quick find. These are the ScaleGroupOrganizationMaintenanceJobs (Type 15 and 61).
The ScalegroupOrganizationMaintenanceJob 15 is the IndexManagement job.
The ScalegroupOrganizationMaintenanceJob 61 is the CheckFullTextIndexColumnStatusOperation job.

To check if they are running or already ran, execute the following queries.

  1. Use this query to find your organization id:
  2. Execute the following queries (replacing [orgid] by the ID of your organization):

    Check the LastRunTime and the NextRunTim. These jobs should run at least weekly. If they haven’t been run, we need to force them to run.
  3. Force the jobs to run, if they haven’t. Be aware, that this may cause performance issues during execution, means that you should execute this not during the office hours.

 

In my case, all queries run correctly. Therefore the Microsoft engineer found the error. The SQL-server creates the catalog itself and therefore excludes some filling words like does, each, else, for, from, get, got and many more. To get the list of all “stopwords”, execute the following query:

Be aware, that each language has its own stopwords.

One possible solution is to disable the stopwords for specific entities, in my case for the account. Therefore, go to the table account, right-click and select the entry “Full-text index” and select properties.

FulltextSearch-Account-Properties

Change the value of “Full-text Index Stoplist” to off. This will disable the stoplist only for the account-entity.

FulltextSearch-Account-DisableStoplist

Based on the restrictions of Microsoft, this should be a supported change, as this is not a change of the schema:

Modifications to the physical schema of the database, other than adding or updating indexes. This includes any actions performed against the database without using the System Customization capabilities in the web application or using the metadata APIs that are described in this SDK documentation. Modifying tables, stored procedures, or views in the database is not supported. Adding tables, stored procedures, or views to the database is also not supported because of referential integrity or upgrade issues.