toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final json = <String, Object?>{'column': column, 'index_type': indexType};
  void add(String key, Object? value) {
    if (value != null) json[key] = value;
  }

  add('name', name);
  add('metric', metric);
  add('replace', replace);
  add('num_partitions', numPartitions);
  add('ivf_centroids', ivfCentroids);
  add('pq_codebook', pqCodebook);
  add('num_sub_vectors', numSubVectors);
  add('accelerator', accelerator);
  add('index_cache_size', indexCacheSize);
  add('shuffle_partition_batches', shufflePartitionBatches);
  add('shuffle_partition_concurrency', shufflePartitionConcurrency);
  add('ivf_centroids_file', ivfCentroidsFile);
  add('precomputed_partition_dataset', precomputedPartitionDataset);
  add('filter_nan', filterNan);
  add('train', train);
  add('fragment_ids', fragmentIds);
  add('index_uuid', indexUuid);
  add('target_partition_size', targetPartitionSize);
  add('skip_transpose', skipTranspose);
  add('num_bits', numBits);
  add('index_file_version', indexFileVersion);
  add('max_level', maxLevel);
  add('m', m);
  add('ef_construction', efConstruction);
  add('with_position', withPosition);
  add('memory_limit', memoryLimit);
  add('num_workers', numWorkers);
  add('skip_merge', skipMerge);
  add('base_tokenizer', baseTokenizer);
  add('language', language);
  add('max_token_length', maxTokenLength);
  add('lower_case', lowerCase);
  add('stem', stem);
  add('remove_stop_words', removeStopWords);
  add('custom_stop_words', customStopWords);
  add('ascii_folding', asciiFolding);
  return json;
}