Lime CRM Search Indexer¶
All data that shall be searchable in a Lime CRM application must
have an index in Elasticsearch. Lime CRM Search indexer is the service responsible for indexing
objects automatically when they're updated in the server. If an object
that shall be searchable is changed or added, an index event
is
triggered internally in Lime CRM. This event is sent to a message queue
(Rabbit MQ) and eventually picked up by the search indexer service from
the queue, which in turns indexes the change.
Information
Data that is not indexed will not be possible to find from the global search in the webclient
What happens when an object is created, updated or deleted?¶
When data is added, changed or deleted through Lime CRM Server, the data is also updated in the search index.
Warning
If data is inserted directly to the sql database, for instance via a SSIS integration, Lime CRM Server has no possibility to detect this. This means that the data will not be searchable in the global search.
The search index is updated if data is added, updated or deleted via:
- The webclient
- The desktop client
- The REST Api
- A custom endpoint
- The importer
If data that needs to be searchable in the webclient is added in any other way, you must manually trigger a reindex of the table that you added this data to. Again, this is a time consuming and CPU intensive process, and is not recommended to do. But sometimes it's neccessarry and then its best solved with a scheduled task that runs a reindex operation periodically (nightly, weekly, monthly...).
Changes to the database structure¶
If a properties (also called field) on a limetype (table) is changed, deleted or added in LISA, a reindex of that limetype is required, otherwise undefined errors might occur.
If a new property (field) is added, it will be indexed and considered to
be of type string
. This means that if you add a new option field, that
field will be considered to be a string in Elasticsearch, which in
turn will lead to undefined behaviors.
Search results¶
When searching in the web client, the results are boosted depending on:
- Limetype (Table) labels
- Property (Field) labels
This means that a match in the search query on a limetype with a limetype label and in a property with a property label is more likely to get a higher boost, and be presented higher in the search result list.
The following property types are possible to search for in the web client:
- text properties
- option properties
- relation properties
Relation properties¶
It's possible to search for information in related objects. However, it's only the descriptive of a related limeobject that is indexed together with the object. This means that it's important to set labels on all limeobjects limetypes that you want to have related information from.
What this means is that if you search for a deal connected to "Company A",
you may get a search hit for "Company A", if the deals label is set to name
.
Working with the search indexer¶
The search indexer is interacted with via limefu
Configuration¶
Connection details are configured as described here.
Service configuration:
# config.yaml
search_indexer:
log_level: INFO
Exclude lime types¶
From lime-crm version 2.413.0, you can configure your application so that certain lime types are not indexed.
This can become very useful if a certain lime type has a huge number of records but
does not need to be searchable, i.e. indexed 1. Lime types such as participant
,
orderrow
or invoicerow
might exist in the quantities of millions, due to integrations.
By excluding such lime types from being indexed, the index becomes smaller,
thus making a re-index much faster.
Add this section to your Config in CAFE (cloud) or application_config.yaml (on-prem) to exclude certain lime types.
Replace participant
and invoicerow
with the lime types you wish to exclude.
search:
exclude_limetypes:
- participant
- invoicerow
-
Please note that these records will still show up in lists, tables, reports and such. They will only be excluded from features where Elastic is used, such as The Global Search and relation pickers. ↩