{"id":14955817,"url":"https://github.com/dougal/acts_as_indexed","last_synced_at":"2025-10-08T18:33:16.059Z","repository":{"id":421612,"uuid":"41487","full_name":"dougal/acts_as_indexed","owner":"dougal","description":"Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app","archived":false,"fork":false,"pushed_at":"2023-08-26T12:32:12.000Z","size":413,"stargazers_count":213,"open_issues_count":12,"forks_count":49,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T09:10:06.379Z","etag":null,"topics":["fulltext-search","ruby","ruby-on-rails","rubyonrails","search-engine"],"latest_commit_sha":null,"homepage":"http://douglasfshearer.com/blog/rails-plugin-acts_as_indexed","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dougal.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2008-08-10T15:14:58.000Z","updated_at":"2025-02-23T12:25:47.000Z","dependencies_parsed_at":"2024-06-18T14:14:10.965Z","dependency_job_id":null,"html_url":"https://github.com/dougal/acts_as_indexed","commit_stats":{"total_commits":341,"total_committers":18,"mean_commits":"18.944444444444443","dds":"0.24633431085043989","last_synced_commit":"c6fda5a2b5a45758fdceb6c1c5c50265df689926"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Facts_as_indexed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Facts_as_indexed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Facts_as_indexed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougal%2Facts_as_indexed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dougal","download_url":"https://codeload.github.com/dougal/acts_as_indexed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248545427,"owners_count":21122143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fulltext-search","ruby","ruby-on-rails","rubyonrails","search-engine"],"created_at":"2024-09-24T13:11:50.909Z","updated_at":"2025-10-08T18:33:11.024Z","avatar_url":"https://github.com/dougal.png","language":"Ruby","funding_links":["http://www.paypal.com/cgi-bin/webscr?cmd=_send-money"],"categories":[],"sub_categories":[],"readme":"= acts_as_indexed\n\nIf you find this plugin useful, please consider a donation to show your\nsupport!\n\nhttp://www.paypal.com/cgi-bin/webscr?cmd=_send-money\n\nPaypal address: mailto:dougal.s@gmail.com\n\n\n== Instructions\n\nThis plugin allows boolean-queried fulltext search to be added to any Rails\napp with no dependencies and minimal setup.\n\n\n== Resources\n\n=== Installation\n\n==== Add to your Gemfile\n\n  gem 'acts_as_indexed'\n\nRun \u003ctt\u003ebundle install\u003c/tt\u003e. Done.\n\n==== Still on Rails 2.x.x without Bundler?\n\n  ./script/plugin install git://github.com/dougal/acts_as_indexed.git\n\nIf you don't have git installed, but still want the plugin, you can download\nthe plugin from the GitHub page (http://github.com/dougal/acts_as_indexed) and\nunpack it into the \u003ctt\u003evendor/plugins\u003c/tt\u003e directory of your rails app.\n\n=== Upgrading\n\nWhen upgrading to a new version of acts_as_indexed it is recommended you\ndelete the index directory and allow it to be rebuilt.\n\n\n== Usage\n\n=== Setup\n\nAdd +acts_as_indexed+ to the top of any models you want to index, along with a\nlist of the fields you wish to be indexed.\n\n  class Post \u003c ActiveRecord::Base\n    acts_as_indexed :fields =\u003e [:title, :body]\n\n    ...\n  end\n\nThe fields are not limited to model fields, but can be any instance method of\nthe current model.\n\n  class User \u003c ActiveRecord::Base\n    acts_as_indexed :fields =\u003e [:address, :fullname]\n\n    def fullname\n      self.firstname + ' ' + self.lastname\n    end\n\n    ...\n  end\n\nAny of the configuration options in the Further Configuration section can be\nadded as to the acts_as_indexed method call. These will override any defaults\nor global configuration.\n\nYou can specify proc that needs to evaluate to true before the item gets\nindexed. This is useful if you only want items with a certain state to be\nincluded. The Proc is passed the current object's instance so you are able to\ntest against that.\n\nFor example, if you have a visible column that is false if the post is hidden,\nor true if it is visible, you can filter the index by doing:\n\n  class Post \u003c ActiveRecord::Base\n    acts_as_indexed :fields =\u003e [:title, :body], :if =\u003e Proc.new { |post| post.visible? }\n    ...\n  end\n\n=== Searching\n\n==== With Relevance\n\nTo search with the most relevant matches appearing first, call the\n+find_with_index+ method on your model, passing a query as the first argument.\nThe optional +ids_only+ parameter, when set to true, will return only the IDs\nof any matching records.\n\n  # Returns array of Post objects ordered by relevance.\n  my_search_results = Post.find_with_index('my search query')\n\n  # Pass any of the ActiveRecord find options to the search.\n  my_search_results = Post.find_with_index('my search query',{:limit =\u003e 10}) # return the first 10 matches.\n\n  # Returns array of IDs ordered by relevance.\n  my_search_results = Post.find_with_index('my search query',{},{:ids_only =\u003e true}) # =\u003e  [12,19,33...\n\n==== Without Relevance (Scope)\n\nIf the relevance of the results is not important, call the +with_query+ named\nscope on your model, passing a query as an argument.\n\n  # Returns array of Post objects.\n  my_search_results = Post.with_query('my search query')\n\n  # Chain it with any number of ActiveRecord methods and named_scopes.\n  my_search_results = Post.public.with_query('my search query').find(:all, :limit =\u003e 10) # return the first 10 matches which are public.\n\n=== Query Options\n\nThe following query operators are supported:\n\nAND :: This is the default option. 'cat dog' will find records matching 'cat' AND 'dog'.\nNOT :: 'cat -dog' will find records matching 'cat' AND NOT 'dog'\nINCLUDE :: 'cat +me' will find records matching 'cat' and 'me', even if 'me' is smaller than the +min_word_size+\n\"\" :: Quoted terms are matched as phrases. '\"cat dog\"' will find records matching the whole phrase. Quoted terms can be preceded by the NOT operator; 'cat -\"big dog\"' etc. Quoted terms can include words shorter than the +min_word_size+.\n^ :: Terms that begin with ^ will match records that contain a word starting with the term. '^cat' will find matches containing 'cat', 'catapult', 'caterpillar' etc.\n^\"\" :: A quoted term that begins with ^ matches any phrase that begin with this phrase. '^\"cat d\"' will find records matching the whole phrases \"cat dog\" and \"cat dinner\". This type of search is useful for autocomplete inputs.\n\n=== Pagination\n\n==== With Relevance\n\nPagination is supported via the +paginate_search+ method whose first argument is the search query, followed by all the standard will_paginate arguments.\n\n  @images = Image.paginate_search('girl', :page =\u003e 1, :per_page =\u003e 5)\n\n==== Without Relevance (Scope)\n\nSince +with_query+ is a named scope, WillPaginate can be used in the normal\nfashion.\n\n  @images = Image.with_query('girl').paginate(:page =\u003e 1, :per_page =\u003e 5)\n\n=== Further Configuration\n\nA config block can be provided in your environment files or initializers.\nExample showing changing the min word size:\n\n  ActsAsIndexed.configure do |config|\n    config.min_word_size = 3\n    # More config as required...\n  end\n\nA full rundown of the available configuration options can be found in\n\u003ctt\u003elib/acts_as_indexed/configuration.rb\u003c/tt\u003e\n\n=== Heroku Support\n\nActs As Indexed supports Heroku out-of-the-box. The index is created in the\ntmp directory, which is the only writeable part of the Heroku dyno filesystem.\nPlease read Heroku's documentation(\nhttps://devcenter.heroku.com/articles/read-only-filesystem) regarding their file-system.\n\n== RDoc Documentation\n\nView the rdoc documentation\nonline[http://rdoc.info/projects/dougal/acts_as_indexed/].\n\n\n== Problems, Comments, Suggestions?\n\nAll of the above are most welcome. mailto:dougal.s@gmail.com\n\n\n== Contributors\n\nA huge thanks to all the contributors to this library. Without them many\nbugfixes and features wouldn't have happened.\n\n* Douglas F Shearer - http://douglasfshearer.com\n* Thomas Pomfret\n* Philip Arndt\n* Fernanda Lopes\n* Alex Coles\n* Myles Eftos\n* Edward Anderson\n* Florent Guilleux\n* Ben Anderson\n* Theron Toomey\n* Uģis Ozols\n* Gabriel Namiman\n* Roman Samoilov\n* David Turner\n* Pascal Hurni\n* Ryan Kopf\n\n\n== Unicode (UTF8) Support\n\nAt the moment acts_as_indexed only works with Unicode characters when used in\nthe following way:\n\n  https://gist.github.com/193903bb4e0d6e5debe1\n\nI have rewritten the tokenization process to allow easier handling of this in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougal%2Facts_as_indexed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougal%2Facts_as_indexed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougal%2Facts_as_indexed/lists"}