import { xLuceneFieldType , ESFieldType , xLuceneTypeConfig } from '@terascope/types' ; import BaseType from '../base-type' ; import { GraphQLType , TypeESMapping } from '../../interfaces' ; export default class GeoJSON extends BaseType { toESMapping ( _version ? ) { if ( this . config . indexed === false ) { throw new Error ( `${ this . constructor . name } is required to be indexed` ) ; } return { mapping : { [ this . field ] : { type : 'geo_shape' as ESFieldType , tree : 'quadtree' , strategy : 'recursive' } } } ; } toGraphQL ( ) { return this . _formatGql ( 'GeoJSON' , 'scalar GeoJSON' ) ; } toXlucene ( ) { return { [ this . field ] : xLuceneFieldType . GeoJSON } ; } }