ปลั๊กอินนี้มีคุณสมบัติต่อไปนี้:
หากคุณใช้ MySQL หรือ Mariadb คุณต้องใช้ Mroonga 9.03 หรือใหม่กว่า
หากคุณใช้ PostgreSQL คุณต้องใช้ Pgroonga 2.2.0 หรือใหม่กว่า
Mroonga และ Pgroonga ใช้ Groonga เป็นเครื่องมือค้นหาข้อความแบบเต็ม คุณต้องการ Groonga 9.0.3 หรือใหม่กว่า
ดูเอกสาร Pgroonga
ดูเอกสาร Mroonga
คุณสามารถเลือกหนึ่งในนั้นเพื่อติดตั้ง chupatext:
แนะนำให้ใช้ Chupa-text-docker ดูเอกสาร Chupa-Text-Docker เพื่อติดตั้ง Chupa-Text-Docker
ดูเอกสาร chupa-text-vagrant เพื่อติดตั้ง chupa-text-vagrant
chupa-text-http-server เป็นทับทิมปกติบนแอปพลิเคชัน Rails เช่น Redmine เอง คุณสามารถปรับใช้ chupa-text-http-server เป็นแอปพลิเคชันทับทิมบนรางปกติ
$ cd redmine
$ git clone https://github.com/clear-code/redmine_full_text_search.git plugins/full_text_search
$ bundle install
$ RAILS_ENV=production bin/rails redmine:plugins:migrateรีสตาร์ท Redmine
หมายเหตุ สำหรับ pgroonga:
หากคุณใช้ผู้ใช้ปกติสำหรับ Redmine คุณต้องเรียกใช้แบบสอบถามต่อไปนี้ในฐานะผู้ใช้ที่ยอดเยี่ยมก่อนเรียกใช้ RAILS_ENV=production bin/rails redmine:plugins:migrate :
CREATE EXTENSION IF NOT EXISTS pgroonga; เปิด https: // your_redmine_server/settings/plugin/full_text_search และกำหนดค่ารายการในหน้า หากคุณติดตั้งเซิร์ฟเวอร์ chupatext คุณต้องกำหนดค่า "url เซิร์ฟเวอร์ chupatext" หากคุณติดตั้งเซิร์ฟเวอร์ Chupatext ของคุณโดย Chupa-Text-Docker หรือ Chupa-Text-Vagrant บนโฮสต์เดียวกันมันคือ http://127.0.0.1:20080/extraction.json
คุณต้องสร้างดัชนีสำหรับข้อมูลที่มีอยู่ คุณต้องเรียกใช้งาน full_text_search:synchronize งานจนกว่าจะไม่มีการซิงโครไนซ์ข้อมูลเป้าหมายอีกต่อไป
$ cd redmine
$ RAILS_ENV=production bin/rails full_text_search:synchronize
$ RAILS_ENV=production bin/rails full_text_search:synchronize
$ RAILS_ENV=production bin/rails full_text_search:synchronize
...ปลั๊กอินนี้รองรับการขยายตัวแบบสอบถาม คุณสามารถใช้คุณสมบัตินี้เพื่อใช้การค้นหาคำพ้องความหมาย
คุณสามารถจัดการรายการการขยายแบบสอบถามด้วย Web UI ในหน้าการดูแลระบบหรือไฟล์ข้อมูล
คุณสามารถใช้รูปแบบต่อไปนี้สำหรับไฟล์ข้อมูล:
หากคุณใช้ CSV ให้ใช้รูปแบบต่อไปนี้:
SOURCE1,DESTINATION1
SOURCE2,DESTINATION2
...
ตัวอย่าง:
MySQL,MySQL
MySQL,MariaDB
MariaDB,MySQL
MariaDB,MariaDB
หากคุณใช้ JSON ให้ใช้รูปแบบใดรูปแบบหนึ่งต่อไปนี้:
[
[ " SOURCE1 " , " DESTINATION1 " ],
[ " SOURCE2 " , " DESTINATION2 " ],
...
][
{ "source" : " SOURCE1 " , "destination" : " DESTINATION1 " },
{ "source" : " SOURCE2 " , "destination" : " DESTINATION2 " },
...
]ตัวอย่าง:
[
[ " MySQL " , " MySQL " ],
[ " MySQL " , " MariaDB " ],
[ " MariaDB " , " MySQL " ],
[ " MariaDB " , " MariaDB " ]
][
{ "source" : " MySQL " , "destination" : " MySQL " },
{ "source" : " MySQL " , "destination" : " MariaDB " },
{ "source" : " MariaDB " , "destination" : " MySQL " },
{ "source" : " MariaDB " , "destination" : " MariaDB " }
]คุณสามารถซิงโครไนซ์รายการการขยายแบบสอบถามกับไฟล์ข้อมูลโดยคำสั่งต่อไปนี้:
$ cd redmine
$ RAILS_ENV=production bin/rails full_text_search:query_expansion:synchronize INPUT=query-expansion.csvคุณสามารถยืนยันรายการการขยายแบบสอบถามปัจจุบันในหน้าการดูแลระบบ
Mroonga ไม่ปลอดภัย หาก MySQL ล้มเหลวในขณะที่อัปเดตข้อมูลใน Mroonga ข้อมูล Mroonga อาจถูกทำลาย
นี่คือคำแนะนำในการกู้คืนจากข้อมูล Mroonga ที่เสีย
หากคุณใช้งาน Redmine Plugin ล่าช้าคุณต้องหยุดคนงานและลบงานสำหรับปลั๊กอินนี้:
$ sudo -H systemctl stop [email protected]
$ cd redmine
$ RAILS_ENV=production bin/rails runner ' Delayed::Job.where(queue: "full_text_search").delete_all 'หยุด mysql:
$ sudo -H systemctl stop mysqldลบไฟล์ที่เกี่ยวข้องกับ Mroonga:
$ cd redmine
$ database_name= $( RAILS_ENV=production bin/rails runner ' puts ActiveRecord::Base.configurations[Rails.env]["database"] ' )
$ sudo -H sh -c " rm -rf /var/lib/mysql/ ${database_name} .mrn* "เริ่ม MySQL:
$ sudo -H systemctl start mysqldตรวจสอบว่า Mroonga ได้รับการติดตั้งอย่างถูกต้องตามคู่มือ Mroonga หากไม่ติดตั้ง Mroonga ให้ติดตั้ง mroonga ดังต่อไปนี้:
$ mysql -u root -p < /usr/share/mroonga/install.sqlตารางทำลายอย่างชัดเจนสำหรับปลั๊กอินนี้:
$ mysql -u root -p ${database_name}
> DROP TABLE IF EXISTS fts_query_expansions ;
> DROP TABLE IF EXISTS fts_targets ;
> DROP TABLE IF EXISTS fts_tags ;
> DROP TABLE IF EXISTS fts_tag_types ;
> DROP TABLE IF EXISTS fts_types ;สร้างสคีมาใหม่สำหรับปลั๊กอินนี้:
$ cd redmine
$ RAILS_ENV=production bin/rails redmine:plugins:migrate NAME=full_text_search VERSION=0
$ RAILS_ENV=production bin/rails redmine:plugins:migrate NAME=full_text_searchหากคุณใช้งาน Redmine Plugin ล่าช้าคุณต้องเริ่มต้นงาน:
$ sudo -H systemctl start [email protected]ซิงโครไนซ์:
$ cd redmine
$ RAILS_ENV=production bin/rails full_text_search:synchronize UPSERT=later นี่คือเครื่องมือที่มีประโยชน์ในการเตรียม:
dev/run-mysql.sh และ dev/run-postgresql.sh : เรียกใช้อินสแตนซ์ RDBMS ใหม่โดย Dockerdev/initialize-redmine.sh : เริ่มต้น redminedev/run-test.sh : เรียกใช้การทดสอบสำหรับปลั๊กอินการค้นหาข้อความแบบเต็มรหัสแหล่งที่มาของโคลน สิ่งนี้จำเป็นเพียงครั้งเดียว
$ git clone https://github.com/redmine/redmine.git
$ cd redmine
$ git checkout 5.0-stable # or something
$ git clone [email protected]: ${YOUR_FORK} /redmine_full_text_search.git plugins/full_text_search คุณสามารถเพิ่มปลั๊กอินเพิ่มเติมใน plugins/
เลือกการกำหนดค่าฐานข้อมูลที่เหมาะสม:
$ ln -fs ../plugins/full_text_search/config/database.yml.example. ${REDMINE_VERSION} . ${RDBMS} config/database.ymlนี่คือตัวอย่างที่จะใช้ Redmine 5.0 และ MySQL:
$ ln -fs ../plugins/full_text_search/config/database.yml.example.5.0.mysql config/database.ymlเรียกใช้ rdbms
สำหรับ mysql:
$ plugins/full_text_search/dev/run-mysql.sh /tmp/mysqlสำหรับ PostgreSQL:
$ plugins/full_text_search/dev/run-postgresql.sh /tmp/postgresqlเริ่มต้น redmine:
$ plugins/full_text_search/dev/initialize-redmine.shเรียกใช้การทดสอบ:
$ plugins/full_text_search/dev/run-test.sh คุณต้องสร้างคลาส Mapper สำหรับแต่ละเป้าหมายการค้นหา ดู lib/full_text_search/*_mapper.rb สำหรับรายละเอียด
คุณต้องเพิ่ม require_dependency "full_text_search/XXX_mapper เพื่อ init.rb เพื่อโหลดคลาส Mapper ใหม่เหล่านี้
คุณสามารถยืนยันการเปลี่ยนแปลงของคุณด้วยวิธีการพัฒนา Redmine ตามปกติ
ตัวอย่างเช่นนี่คือบรรทัดคำสั่งที่จะเรียกใช้ Redmine:
$ bin/rails serverคุณต้องเพิ่มการทดสอบในไฟล์ต่อไปนี้:
test/unit/full_text_search/XXX_test.rbtest/functional/full_text_search/search_controller_test.rbนี่คือบรรทัดคำสั่งที่จะเรียกใช้การทดสอบ:
$ plugins/full_text_search/dev/run-test.sh คุณสามารถระบุตัวเลือกการทดสอบโดย TESTOPTS :
$ plugins/full_text_search/dev/run-test.sh TESTOPTS= " -n/test_XXX/ " คุณสามารถดูตัวเลือกการทดสอบทั้งหมดโดย TESTOPTS=--help :
$ plugins/full_text_search/dev/run-test.sh TESTOPTS=--help Kenji Okimoto
Sutou Kouhei <[email protected]>
Shimadzu Corporation
ใบอนุญาต MIT ดูใบอนุญาตสำหรับรายละเอียด
asserts/stylesheets/fontawesome*/**/*asserts/stylesheets/fontawesome*/LICENSE.txt สำหรับรายละเอียด git checkout -b my-new-feature )git commit -am 'Add some feature' )git push origin my-new-feature ไปยังสาขา