Skip to content

Conversation

@ucan-lab
Copy link
Owner

@ucan-lab ucan-lab commented Feb 19, 2022

close #180

  • fullText index modifier type
  • language specified fullText index

Write this in schema.yml.

example5:
  columns:
    id: bigIncrements
    body1: longText
    body2: longText
    body3: longText
    body4: longText
  indexes:
    - columns: body1
      type: fullText
    - columns: body2
      type: fullText
      name: example5_body2_fullText
    - columns: body3
      type: fullText
      language: english
    - columns: body4
      type: fullText
      language: english
      name: example5_body4_fullText

1970_01_01_000001_create_example5_table.php is generated.

    public function up()
    {
        Schema::create('example5', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->longText('body1');
            $table->longText('body2');
            $table->longText('body3');
            $table->longText('body4');
        });
    }

    public function down()
    {
        Schema::dropIfExists('example5');
    }

1970_01_01_000002_create_example5_index.php is generated.

    public function up()
    {
        Schema::table('example5', function (Blueprint $table) {
            $table->fullText('body1');
            $table->fullText('body2', 'example5_body2_fullText');
            $table->fullText('body3')->language('english');
            $table->fullText('body4', 'example5_body4_fullText')->language('english');
        });
    }

    public function down()
    {
        Schema::table('example5', function (Blueprint $table) {
            $table->dropFullText(['body1']);
            $table->dropFullText('example5_body2_fullText');
            $table->dropFullText(['body3']);
            $table->dropFullText('example5_body4_fullText');
        });
    }

@ucan-lab ucan-lab self-assigned this Feb 19, 2022
@ucan-lab ucan-lab merged commit d6320d7 into main Feb 19, 2022
@ucan-lab ucan-lab deleted the topic-180 branch February 19, 2022 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Full Text Indexes

1 participant