-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial attempt at mysql fulltext search for nodes (#1913)
* initial attempt at mysql fulltext search for nodes * tweak * major rails 4.x update of schema.rb, added fulltext index * Update node.rb * Update node_test.rb * rename * self. * add title to fulltext * plugged into typeahead * rev title fulltext index * fixed fulltext multi index * updated schema example * fix * tweaked working fulltext in console * removing solr test apparatus * full text comment and user bio searching * more conditions * fixes * unique results by grouping by nid * Remove Solr stuff and add secret_token env var (#259) * Remove Solr stuff and add secret_token env var * Upgrade and switch database engine to Mariadb.
- Loading branch information
Showing
16 changed files
with
375 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class RevisionFulltextIndex < ActiveRecord::Migration | ||
def up | ||
if ActiveRecord::Base.connection.adapter_name == 'Mysql2' | ||
add_index :node_revisions, [:body, :title], type: :fulltext | ||
add_index :comments, :comment, type: :fulltext | ||
add_index :rusers, [:username, :bio], type: :fulltext | ||
end | ||
end | ||
|
||
def down | ||
if ActiveRecord::Base.connection.adapter_name == 'Mysql2' | ||
remove_index :node_revisions, [:body, :title] | ||
remove_index :comments, :comment | ||
remove_index :rusers, [:username, :bio] | ||
end | ||
end | ||
end |
Oops, something went wrong.