Search for related field as a filter is not working

Hi,
I am having issues with the filters in modules. When I create relate field in meetings to contacts, the field works find. But when I try to use it as a filter it doesn’t show any results.
So I added the field to the fts setup, re-index the records and still no results.
Can someone help me fixing the field so I can use it as a search field?

Could you post your FTS config for meetings?

Yes, of course. The name of the field is relate_contact_c

When you add field to FTS use tree to get to related module and fields

In the end you shall have something similar to this

Your Link name will be something else. Check in your vardefs

Yes, I agree with that, but this setup is for relationships such as: 1:1, 1:M, M:M.
I am trying to use relate field, because it can be found in the filters for the current module.
Example:


So my issue is to make this field work as a search field.

How did you define your field?
Could you post your vardefs?

Hi, I followed your description for setting up a relationship field in the fts.
I used standard relationship between accounts and contacts in module Contacts. For the test I added field ‘name’ (from the account) to the contacts’ fts. after re-indexing, re-login I didn’t find field ‘name’ in contacts filters for custom search.


Plus I have this as vardef information:

        'accounts' => array(
                'name' => 'accounts',
                'type' => 'link',
                'relationship' => 'accounts_contacts',
                'link_type' => 'one',
                'source' => 'non-db',
                'vname' => 'LBL_ACCOUNT',
                'duplicate_merge' => 'disabled',
                'module' => 'Accounts'
            ),			
        'account_name' => array(
            'name' => 'account_name',
            'rname' => 'name',
            'id_name' => 'account_id',
            'vname' => 'LBL_ACCOUNT_NAME',
            'join_name' => 'accounts',
            'type' => 'relate',
            'link' => 'accounts',
            'table' => 'accounts',
            'isnull' => 'true',
            'module' => 'Accounts',
            'dbType' => 'varchar',
            'len' => '255',
            'source' => 'non-db',
            'unified_search' => true,
        ),
        'account_id' => array(
            'name' => 'account_id',
            'rname' => 'id',
            'id_name' => 'account_id',
            'vname' => 'LBL_ACCOUNT_ID',
            'type' => 'relate',
            'table' => 'accounts',
            'isnull' => 'true',
            'module' => 'Accounts',
            'dbType' => 'id',
            'reportable' => false,
            'source' => 'non-db',
            'massupdate' => false,
            'duplicate_merge' => 'disabled',
            'hideacl' => true,
        ),

I had a look at the logic for the listview filters: the list does not come from fts configuration.
It comes from the vardefs.
Depending on the field type and properties the field is listed or not listed.
In the case of account_name, the conditions for listing do not match. That’s why account_name is not present in the list. account_name in Contacts is indeed a complex relate field, based on relate field for the id and the search query can’t be built properly in current logic.

Workaround: write the account name as a search term.

Let me summarize:

  • The name, id, and link fields associated with relationships do not appear in the list of filter fields.
  • This is not related to any FTS configuration but depends on fields definitions in vardefs.
  • It is possible though to use these fields as aggregates in case they are configured through the FTS.

Is the above correct?

To cover and close the whole topic I would to touch also filter issues in case a pure relate (not associated with a relationship) is used.

  • These relate fields appear in the list of filter fields.
  • In the filters you can select such a field to be equal to specific record from the related module (Spice identifies the related module and allows a record to be selected through the related fields).
  • The problem is - filter with relate field never returns any results. In case the relate field is not in the FTS configuration - the list view is frozen with grey empty records. In case the relate field is in the FTS configuration the filter returns always 0 records.

What are the options to use pure relate fields in filters in Spice?