Class: Gifts::TermTable

Inherits:
TableBase show all
Defined in:
lib/gifts/term_table.rb

Instance Method Summary collapse

Methods inherited from TableBase

#initialize

Constructor Details

This class inherits a constructor from Gifts::TableBase

Instance Method Details

#define_schemaObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gifts/term_table.rb', line 7

def define_schema
  Groonga::Schema.define do |schema|
    schema.create_table(
      "term",
      type: :patricia_trie,
      normalizer: :NormalizerAuto,
      default_tokenizer: "TokenBigram"
    ) do |table|
      table.index("commit.message", with_position: true)

      table.index("diff.commit", with_position: true)
      table.index("diff.diff", with_position: true)

      table.index("file.ext", with_position: true)
      table.index("file.path", with_position: true)

      table.index("user.name", with_position: true)
    end
  end
end

#table_nameObject



3
4
5
# File 'lib/gifts/term_table.rb', line 3

def table_name
  "term"
end