<?php

final class PhabricatorSearchDocumentField extends PhabricatorSearchDAO {

  protected $phidType;
  protected $field;
  protected $auxPHID;
  protected $corpus;

  public function getConfiguration() {
    return array(
      self::CONFIG_TIMESTAMPS => false,
      self::CONFIG_IDS        => self::IDS_MANUAL,
      self::CONFIG_COLUMN_SCHEMA => array(
        'phidType' => 'text4',
        'field' => 'text4',
        'auxPHID' => 'phid?',
        'corpus' => 'text?',
      ),
      self::CONFIG_KEY_SCHEMA => array(
        'key_phid' => null,
        'phid' => array(
          'columns' => array('phid'),
        ),
        'corpus' => array(
          'columns' => array('corpus'),
          'type' => 'FULLTEXT',
        ),
      ),
    ) + parent::getConfiguration();
  }

  public function getIDKey() {
    return 'phid';
  }

}

<?php

final class PhabricatorSearchDocumentField extends PhabricatorSearchDAO {

  protected $phidType;
  protected $field;
  protected $auxPHID;
  protected $corpus;

  public function getConfiguration() {
    return array(
      self::CONFIG_TIMESTAMPS => false,
      self::CONFIG_IDS        => self::IDS_MANUAL,
      self::CONFIG_COLUMN_SCHEMA => array(
        'phidType' => 'text4',
        'field' => 'text4',
        'auxPHID' => 'phid?',
        'corpus' => 'sort?',
      ),
      self::CONFIG_KEY_SCHEMA => array(
        'key_phid' => null,
        'phid' => array(
          'columns' => array('phid'),
        ),
        'corpus' => array(
          'columns' => array('corpus'),
          'type' => 'FULLTEXT',
        ),
      ),
    ) + parent::getConfiguration();
  }

  public function getIDKey() {
    return 'phid';
  }

}

Use `sort`, not `text`, for search index table
Use `sort`, not `text`, for search index table

Summary: Ref T1191. The index's case sensitivity depends on the column type. Using `text` makes the search case-sensitive, which is not desirable.

Test Plan: After adjustment, searched for "PROJECTS" and found hits against "projects".

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10619
