mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
0d61af5f03
Summary: See diff title Test Plan: Run it Reviewers: juan, mg, evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D3794
38 lines
650 B
JavaScript
38 lines
650 B
JavaScript
import {
|
|
Contact,
|
|
ModelSearchIndexer,
|
|
} from 'nylas-exports';
|
|
|
|
|
|
const INDEX_VERSION = 1;
|
|
|
|
class ContactSearchIndexer extends ModelSearchIndexer {
|
|
|
|
get MaxIndexSize() {
|
|
return 100000;
|
|
}
|
|
|
|
get ModelClass() {
|
|
return Contact;
|
|
}
|
|
|
|
get ConfigKey() {
|
|
return "contactSearchIndexVersion";
|
|
}
|
|
|
|
get IndexVersion() {
|
|
return INDEX_VERSION;
|
|
}
|
|
|
|
getIndexDataForModel(contact) {
|
|
return {
|
|
content: [
|
|
contact.name ? contact.name : '',
|
|
contact.email ? contact.email : '',
|
|
contact.email ? contact.email.replace('@', ' ') : '',
|
|
].join(' '),
|
|
};
|
|
}
|
|
}
|
|
|
|
export default new ContactSearchIndexer()
|