[SFDC] Update SalesforceSearchIndexer for new search indexing

Summary:
Update Salesforce to use the new search indexer

Depends on D3911

Test Plan: Manually bootup SFDC and ensure it launches and indexes models properly

Reviewers: mark, halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3913
This commit is contained in:
Evan Morikawa 2017-02-15 11:33:28 -08:00
parent 04478f81c8
commit f409bf8be1
2 changed files with 29 additions and 0 deletions

View file

@ -70,6 +70,30 @@ class SalesforceObject extends Model {
modelKey: 'rawData',
jsonKey: 'rawData',
}),
isSearchIndexed: Attributes.Boolean({
queryable: true,
modelKey: 'isSearchIndexed',
jsonKey: 'is_search_indexed',
defaultValue: false,
loadFromColumn: true,
}),
// This corresponds to the rowid in the FTS table. We need to use the FTS
// rowid when updating and deleting items in the FTS table because otherwise
// these operations would be way too slow on large FTS tables.
searchIndexId: Attributes.Number({
modelKey: 'searchIndexId',
jsonKey: 'search_index_id',
}),
}
static sortOrderAttribute = () => {
return SalesforceObject.attributes.name
}
static naturalSortOrder = () => {
return SalesforceObject.sortOrderAttribute().descending()
}
static additionalSQLiteConfig = {

View file

@ -2,6 +2,11 @@ import { ModelSearchIndexer } from 'nylas-exports';
import SalesforceObject from '../models/salesforce-object'
class SalesforceSearchIndexer extends ModelSearchIndexer {
get MaxIndexSize() {
return 10000
}
get ConfigKey() {
return "salesforce.searchIndexVersion"
}