You are here

protected function DrupalSolrMatchTestCase::populateIndex in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::populateIndex()
  2. 7 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::populateIndex()

Set up a small index of items to test against.

1 call to DrupalSolrMatchTestCase::populateIndex()
DrupalSolrMatchTestCase::testMatching in tests/solr_index_and_search.test
Test search indexing.

File

tests/solr_index_and_search.test, line 211

Class

DrupalSolrMatchTestCase

Code

protected function populateIndex($count) {
  variable_set('minimum_word_size', 3);
  for ($i = 1; $i <= $count; ++$i) {
    $documents[] = $this
      ->buildDocument(array(
      'entity_id' => $i,
      'content' => $this
        ->getText($i),
    ));
  }
  $this->solr
    ->addDocuments($documents);
  $this->solr
    ->commit();
}