KITAITI Makoto
null+****@clear*****
Tue Mar 15 19:30:56 JST 2016
KITAITI Makoto 2016-03-15 19:30:56 +0900 (Tue, 15 Mar 2016) New Revision: 08725a2e0da4ef421379674dafcbdd45dffa09c7 https://github.com/ranguba/epub-searcher/commit/08725a2e0da4ef421379674dafcbdd45dffa09c7 Message: Add unique_identifier and modified columns to the table Modified files: lib/epub-searcher/database.rb lib/epub-searcher/remote-database.rb Modified: lib/epub-searcher/database.rb (+4 -0) =================================================================== --- lib/epub-searcher/database.rb 2016-03-14 19:51:06 +0900 (df4a360) +++ lib/epub-searcher/database.rb 2016-03-15 19:30:56 +0900 (51aa711) @@ -55,6 +55,8 @@ module EPUBSearcher "main_text" => epub_document.extract_main_text, "title" => epub_document.extract_title, "file_path" => epub_document.file_path, + "unique_identifier" => epub_document.extract_unique_identifier, + "modified" => epub_document.extract_modified, } end command << records.to_json @@ -68,6 +70,8 @@ column_create Books author COLUMN_SCALAR ShortText column_create Books main_text COLUMN_SCALAR LongText column_create Books title COLUMN_SCALAR ShortText column_create Books file_path COLUMN_SCALAR ShortText +column_create Books unique_identifier COLUMN_SCALAR ShortText +column_create Books modified COLUMN_SCALAR Time table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto column_create Terms entries_title_index COLUMN_INDEX|WITH_POSITION Books title column_create Terms entries_main_text_index COLUMN_INDEX|WITH_POSITION Books main_text Modified: lib/epub-searcher/remote-database.rb (+9 -1) =================================================================== --- lib/epub-searcher/remote-database.rb 2016-03-14 19:51:06 +0900 (ab9ab55) +++ lib/epub-searcher/remote-database.rb 2016-03-15 19:30:56 +0900 (d6296e5) @@ -49,7 +49,7 @@ module EPUBSearcher private def groonga_setup_db_books @client.table_create(:name => :Books, :flags => 'TABLE_NO_KEY') - ['author', 'file_path', 'title'].each do |column| + ['author', 'file_path', 'title', 'unique_identifier'].each do |column| @client.column_create( :table => :Books, :name => column, @@ -63,6 +63,12 @@ module EPUBSearcher :flags => 'COLUMN_SCALAR', :type => :LongText, ) + @client.column_create( + :table => :Books, + :name => 'modified', + :flags => 'COLUMN_SCALAR', + :type => :Time, + ) end def groonga_setup_db_terms @@ -91,6 +97,8 @@ module EPUBSearcher :main_text => epub_document.extract_main_text, :title => epub_document.extract_title, :file_path => epub_document.file_path, + :unique_identifier => epub_document.extract_unique_identifier, + :modified => epub_document.extract_modified, } end @client.load(:table => :Books, :values => records.to_json) -------------- next part -------------- HTML����������������������������...Download