<commit_before>'use strict';

describe('searchDoc', function () {
  let db;

  before(function () {
    return resetDb().then(instance => db = instance);
  });

  after(function () {
    return db.instance.$pool.end();
  });

  it('works on single key', function () {
    return db.docs.searchDoc({
      fields: ['title'],
      term: 'Something'
    }).then(docs => {
      assert.lengthOf(docs, 1);
    });
  });

  it('works on multiple fields', function () {
    return db.docs.searchDoc({
      fields: ['title', 'description'],
      term: 'Else'
    }).then(docs => {<commit_msg>have searchDoc use data-docs (#491)<commit_after>'use strict';

describe('searchDoc', function () {
  let db;

  before(function () {
    return resetDb('data-docs').then(instance => db = instance);
  });

  after(function () {
    return db.instance.$pool.end();
  });

  it('works on single key', function () {
    return db.docs.searchDoc({
      fields: ['title'],
      term: 'Something'
    }).then(docs => {
      assert.lengthOf(docs, 1);
    });
  });

  it('works on multiple fields', function () {
    return db.docs.searchDoc({
      fields: ['title', 'description'],
      term: 'Else'
    }).then(docs => {
{'fraction_non_alphanumeric': 0.19138359569179786, 'fraction_numerical': 0.004142502071251036, 'mean_word_length': 2.9348534201954397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1179551', 'n_tokens_mistral': 389, 'n_tokens_neox': 370, 'n_words': 86}