import { xLuceneFieldType , ESFieldType , xLuceneTypeConfig } from '@terascope/types' ; import BaseType from '../base-type' ; import { GraphQLType , TypeESMapping } from '../../interfaces' ; export default class Keyword extends BaseType { toESMapping ( _version ? ) { return { mapping : { [ this . field ] : this . config . indexed === false ? { type : 'keyword' as ESFieldType , index : false } : { type : 'keyword' as ESFieldType } } } ; } toGraphQL ( ) { if ( this . field === '_key' ) { return this . _formatGql ( 'ID' ) ; } return this . _formatGql ( 'String' ) ; } toXlucene ( ) { return { [ this . field ] : xLuceneFieldType . String } ; } }