quest_search 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +41 -0
  3. data/doc/AddQuestSearchIndexTo.html +139 -0
  4. data/doc/Gemfile.html +101 -0
  5. data/doc/QuestSearch.html +149 -0
  6. data/doc/QuestSearch/Generators.html +133 -0
  7. data/doc/QuestSearch/Generators/MigrationGenerator.html +235 -0
  8. data/doc/QuestSearch/QuestSearchOn.html +217 -0
  9. data/doc/QuestSearch/QuestSearchOn/ClassMethods.html +252 -0
  10. data/doc/README.html +147 -0
  11. data/doc/Rakefile.html +104 -0
  12. data/doc/created.rid +9 -0
  13. data/doc/images/add.png +0 -0
  14. data/doc/images/brick.png +0 -0
  15. data/doc/images/brick_link.png +0 -0
  16. data/doc/images/bug.png +0 -0
  17. data/doc/images/bullet_black.png +0 -0
  18. data/doc/images/bullet_toggle_minus.png +0 -0
  19. data/doc/images/bullet_toggle_plus.png +0 -0
  20. data/doc/images/date.png +0 -0
  21. data/doc/images/delete.png +0 -0
  22. data/doc/images/find.png +0 -0
  23. data/doc/images/loadingAnimation.gif +0 -0
  24. data/doc/images/macFFBgHack.png +0 -0
  25. data/doc/images/package.png +0 -0
  26. data/doc/images/page_green.png +0 -0
  27. data/doc/images/page_white_text.png +0 -0
  28. data/doc/images/page_white_width.png +0 -0
  29. data/doc/images/plugin.png +0 -0
  30. data/doc/images/ruby.png +0 -0
  31. data/doc/images/tag_blue.png +0 -0
  32. data/doc/images/tag_green.png +0 -0
  33. data/doc/images/transparent.png +0 -0
  34. data/doc/images/wrench.png +0 -0
  35. data/doc/images/wrench_orange.png +0 -0
  36. data/doc/images/zoom.png +0 -0
  37. data/doc/index.html +92 -0
  38. data/doc/js/darkfish.js +153 -0
  39. data/doc/js/jquery.js +18 -0
  40. data/doc/js/navigation.js +142 -0
  41. data/doc/js/search.js +94 -0
  42. data/doc/js/search_index.js +1 -0
  43. data/doc/js/searcher.js +228 -0
  44. data/doc/lib/generators/quest_search/migration/migration_generator_rb.html +95 -0
  45. data/doc/lib/generators/templates/add_quest_search_index_rb.html +95 -0
  46. data/doc/lib/quest_search/quest_search_on_rb.html +95 -0
  47. data/doc/lib/quest_search/version_rb.html +95 -0
  48. data/doc/lib/quest_search_rb.html +95 -0
  49. data/doc/rdoc.css +543 -0
  50. data/doc/table_of_contents.html +92 -0
  51. data/lib/quest_search/version.rb +1 -1
  52. data/rdoc/AddQuestSearchIndexTo.html +149 -0
  53. data/rdoc/QuestSearch.html +175 -0
  54. data/rdoc/QuestSearch/Generators.html +151 -0
  55. data/rdoc/QuestSearch/Generators/MigrationGenerator.html +251 -0
  56. data/rdoc/QuestSearch/QuestSearchOn.html +238 -0
  57. data/rdoc/QuestSearch/QuestSearchOn/ClassMethods.html +266 -0
  58. data/rdoc/README_rdoc.html +144 -0
  59. data/rdoc/created.rid +7 -0
  60. data/rdoc/images/brick.png +0 -0
  61. data/rdoc/images/brick_link.png +0 -0
  62. data/rdoc/images/bug.png +0 -0
  63. data/rdoc/images/bullet_black.png +0 -0
  64. data/rdoc/images/bullet_toggle_minus.png +0 -0
  65. data/rdoc/images/bullet_toggle_plus.png +0 -0
  66. data/rdoc/images/date.png +0 -0
  67. data/rdoc/images/find.png +0 -0
  68. data/rdoc/images/loadingAnimation.gif +0 -0
  69. data/rdoc/images/macFFBgHack.png +0 -0
  70. data/rdoc/images/package.png +0 -0
  71. data/rdoc/images/page_green.png +0 -0
  72. data/rdoc/images/page_white_text.png +0 -0
  73. data/rdoc/images/page_white_width.png +0 -0
  74. data/rdoc/images/plugin.png +0 -0
  75. data/rdoc/images/ruby.png +0 -0
  76. data/rdoc/images/tag_green.png +0 -0
  77. data/rdoc/images/wrench.png +0 -0
  78. data/rdoc/images/wrench_orange.png +0 -0
  79. data/rdoc/images/zoom.png +0 -0
  80. data/rdoc/index.html +76 -0
  81. data/rdoc/js/darkfish.js +116 -0
  82. data/rdoc/js/jquery.js +32 -0
  83. data/rdoc/js/quicksearch.js +114 -0
  84. data/rdoc/js/thickbox-compressed.js +10 -0
  85. data/rdoc/lib/generators/quest_search/migration/migration_generator_rb.html +56 -0
  86. data/rdoc/lib/generators/templates/add_quest_search_index_rb.html +52 -0
  87. data/rdoc/lib/quest_search/quest_search_on_rb.html +54 -0
  88. data/rdoc/lib/quest_search/version_rb.html +52 -0
  89. data/rdoc/lib/quest_search_rb.html +54 -0
  90. data/rdoc/rdoc.css +763 -0
  91. metadata +90 -2
  92. data/README +0 -33
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,41 @@
1
+ = Quest
2
+
3
+ Very naive full text search implementation for ActiveRecord based on naive-search by Tomas Jogin (http://github.com/tjogin). Orders results by relevance. Works like this:
4
+
5
+ * The contents of all the specified fields are stored in a text field.
6
+ * Every word in a search query is matched against that text field, in SQL using +like+.
7
+ * The returned results are then re-ordered based on how well they match the query and the words the query is made up of.
8
+
9
+ It Doesn't Scale, much. For situations when more ambitious search solutions are overkill.
10
+
11
+ == Installation
12
+
13
+ gem install quest_search
14
+
15
+ == Usage
16
+
17
+ Run the migration generator on your model, like so:
18
+
19
+ rails generate quest_search:migration Person
20
+
21
+ Run it. Then use as follows:
22
+
23
+ class Person < ActiveRecord::Base
24
+ quest_search_on :name, :surname, :description
25
+ end
26
+
27
+ This makes the specified fields searchable like so:
28
+
29
+ Person.quest_search_for 'my query'
30
+
31
+ Optionally, you can specify the order and limit of results to return from the database:
32
+
33
+ class Person < ActiveRecord::Base
34
+ quest_search_on :name, :surname, :description, :order => "id desc", :limit => 20
35
+ end
36
+
37
+ Note that the search results will still be re-ordered based on fuzzy "relevance", this simply specifies how many results to retrieve from the database, and in which order.
38
+
39
+ == License
40
+
41
+ This project uses MIT-LICENSE.
@@ -0,0 +1,139 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>Class: AddQuestSearchIndexTo</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/generators/templates/add_quest_search_index.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link">%= class_name.singularize %> < ActiveRecord::Migration def up add_column :<%= class_name.tableize %>, :quest_search_index, :text end def down remove_column :<%= class_name.tableize %>, :quest_search_index end end
63
+
64
+ </nav>
65
+
66
+
67
+
68
+ </div>
69
+
70
+ <div id="project-metadata">
71
+ <nav id="fileindex-section" class="section project-section">
72
+ <h3 class="section-header">Pages</h3>
73
+
74
+ <ul>
75
+
76
+ <li class="file"><a href="./Gemfile.html">Gemfile</a>
77
+
78
+ <li class="file"><a href="./README.html">README</a>
79
+
80
+ <li class="file"><a href="./Rakefile.html">Rakefile</a>
81
+
82
+ </ul>
83
+ </nav>
84
+
85
+ <nav id="classindex-section" class="section project-section">
86
+ <h3 class="section-header">Class and Module Index</h3>
87
+
88
+ <ul class="link-list">
89
+
90
+ <li><a href="./QuestSearch.html">QuestSearch</a>
91
+
92
+ <li><a href="./QuestSearch/Generators.html">QuestSearch::Generators</a>
93
+
94
+ <li><a href="./QuestSearch/Generators/MigrationGenerator.html">QuestSearch::Generators::MigrationGenerator</a>
95
+
96
+ <li><a href="./QuestSearch/QuestSearchOn.html">QuestSearch::QuestSearchOn</a>
97
+
98
+ <li><a href="./QuestSearch/QuestSearchOn/ClassMethods.html">QuestSearch::QuestSearchOn::ClassMethods</a>
99
+
100
+ <li><a href="./AddQuestSearchIndexTo.html">AddQuestSearchIndexTo</a>
101
+
102
+ </ul>
103
+ </nav>
104
+
105
+ </div>
106
+ </nav>
107
+
108
+ <div id="documentation">
109
+ <h1 class="class">class AddQuestSearchIndexTo</h1>
110
+
111
+ <div id="description" class="description">
112
+
113
+ </div><!-- description -->
114
+
115
+
116
+
117
+
118
+ <section id="5Buntitled-5D" class="documentation-section">
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+ <!-- Methods -->
128
+
129
+ </section><!-- 5Buntitled-5D -->
130
+
131
+ </div><!-- documentation -->
132
+
133
+
134
+ <footer id="validator-badges">
135
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
136
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
137
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
138
+ </footer>
139
+
data/doc/Gemfile.html ADDED
@@ -0,0 +1,101 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>Gemfile</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body class="file">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="project-metadata">
47
+ <nav id="fileindex-section" class="section project-section">
48
+ <h3 class="section-header">Pages</h3>
49
+
50
+ <ul>
51
+
52
+ <li class="file"><a href="./Gemfile.html">Gemfile</a>
53
+
54
+ <li class="file"><a href="./README.html">README</a>
55
+
56
+ <li class="file"><a href="./Rakefile.html">Rakefile</a>
57
+
58
+ </ul>
59
+ </nav>
60
+
61
+ <nav id="classindex-section" class="section project-section">
62
+ <h3 class="section-header">Class and Module Index</h3>
63
+
64
+ <ul class="link-list">
65
+
66
+ <li><a href="./QuestSearch.html">QuestSearch</a>
67
+
68
+ <li><a href="./QuestSearch/Generators.html">QuestSearch::Generators</a>
69
+
70
+ <li><a href="./QuestSearch/Generators/MigrationGenerator.html">QuestSearch::Generators::MigrationGenerator</a>
71
+
72
+ <li><a href="./QuestSearch/QuestSearchOn.html">QuestSearch::QuestSearchOn</a>
73
+
74
+ <li><a href="./QuestSearch/QuestSearchOn/ClassMethods.html">QuestSearch::QuestSearchOn::ClassMethods</a>
75
+
76
+ <li><a href="./AddQuestSearchIndexTo.html">AddQuestSearchIndexTo</a>
77
+
78
+ </ul>
79
+ </nav>
80
+
81
+ </div>
82
+ </nav>
83
+
84
+ <div id="documentation" class="description">
85
+
86
+ <p>source “<a href="http://rubygems.org">rubygems.org</a>”</p>
87
+
88
+ <p># Specify your gem’s dependencies in quest.gemspec gemspec</p>
89
+
90
+ <p>gem “unicode_utils”</p>
91
+
92
+ </div>
93
+
94
+
95
+
96
+ <footer id="validator-badges">
97
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
98
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
99
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
100
+ </footer>
101
+
@@ -0,0 +1,149 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>Module: QuestSearch</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="module">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/quest_search/quest_search_on.rb
51
+ <li>lib/quest_search/version.rb
52
+ <li>lib/quest_search.rb
53
+ <li>lib/generators/quest_search/migration/migration_generator.rb
54
+ </ul>
55
+ </nav>
56
+
57
+
58
+ </div>
59
+
60
+ <div id="class-metadata">
61
+
62
+
63
+
64
+
65
+ </div>
66
+
67
+ <div id="project-metadata">
68
+ <nav id="fileindex-section" class="section project-section">
69
+ <h3 class="section-header">Pages</h3>
70
+
71
+ <ul>
72
+
73
+ <li class="file"><a href="./Gemfile.html">Gemfile</a>
74
+
75
+ <li class="file"><a href="./README.html">README</a>
76
+
77
+ <li class="file"><a href="./Rakefile.html">Rakefile</a>
78
+
79
+ </ul>
80
+ </nav>
81
+
82
+ <nav id="classindex-section" class="section project-section">
83
+ <h3 class="section-header">Class and Module Index</h3>
84
+
85
+ <ul class="link-list">
86
+
87
+ <li><a href="./QuestSearch.html">QuestSearch</a>
88
+
89
+ <li><a href="./QuestSearch/Generators.html">QuestSearch::Generators</a>
90
+
91
+ <li><a href="./QuestSearch/Generators/MigrationGenerator.html">QuestSearch::Generators::MigrationGenerator</a>
92
+
93
+ <li><a href="./QuestSearch/QuestSearchOn.html">QuestSearch::QuestSearchOn</a>
94
+
95
+ <li><a href="./QuestSearch/QuestSearchOn/ClassMethods.html">QuestSearch::QuestSearchOn::ClassMethods</a>
96
+
97
+ <li><a href="./AddQuestSearchIndexTo.html">AddQuestSearchIndexTo</a>
98
+
99
+ </ul>
100
+ </nav>
101
+
102
+ </div>
103
+ </nav>
104
+
105
+ <div id="documentation">
106
+ <h1 class="module">module QuestSearch</h1>
107
+
108
+ <div id="description" class="description">
109
+
110
+ </div><!-- description -->
111
+
112
+
113
+
114
+
115
+ <section id="5Buntitled-5D" class="documentation-section">
116
+
117
+
118
+
119
+
120
+
121
+ <!-- Constants -->
122
+ <section id="constants-list" class="section">
123
+ <h3 class="section-header">Constants</h3>
124
+ <dl>
125
+
126
+ <dt id="VERSION">VERSION
127
+
128
+ <dd class="description">
129
+
130
+
131
+ </dl>
132
+ </section>
133
+
134
+
135
+
136
+
137
+ <!-- Methods -->
138
+
139
+ </section><!-- 5Buntitled-5D -->
140
+
141
+ </div><!-- documentation -->
142
+
143
+
144
+ <footer id="validator-badges">
145
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
146
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.11.
147
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
148
+ </footer>
149
+