{"id":16777889,"url":"https://github.com/mschae/rawscsi","last_synced_at":"2025-03-16T19:19:09.502Z","repository":{"id":14643824,"uuid":"17361620","full_name":"mschae/rawscsi","owner":"mschae","description":"Rails Amazon Web Services Cloud Search Interface","archived":false,"fork":false,"pushed_at":"2014-03-04T18:15:36.000Z","size":165,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T05:44:44.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":false,"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/mschae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-03T09:48:09.000Z","updated_at":"2014-10-10T23:41:38.000Z","dependencies_parsed_at":"2022-08-23T17:10:39.384Z","dependency_job_id":null,"html_url":"https://github.com/mschae/rawscsi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Frawscsi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Frawscsi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Frawscsi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mschae%2Frawscsi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mschae","download_url":"https://codeload.github.com/mschae/rawscsi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918631,"owners_count":20368745,"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":[],"created_at":"2024-10-13T07:26:11.056Z","updated_at":"2025-03-16T19:19:09.483Z","avatar_url":"https://github.com/mschae.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rawscsi\n\nRails Amazon Web Services Cloud Search Interface\n\nHere's the official aws documentation: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching.html\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'rawscsi'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rawscsi\n\n## Usage\n\n### Configuration\n\n```ruby\nRawscsi.configure do |config|\n  config.model = 'Article'\n  config.domainname = 'prod-br-articles'\n  config.domainid = 'puvb75tayhp4vxtqrk52ear3ty'\n  config.region = 'us-east-1'\n  config.api_version = '2011-02-01'\nend\n```\n\n### Using the search helper programatically\n```ruby\nsearch_songs_helper = Rawscsi::SearchHelper.new\n```\n\nYou can set default search conditions\n\n```ruby\nsearch_songs_helper.default_conditions = {:limit =\u003e 10}\n```\n\nUse it to search over an aws search domain. It returns an array of active record models, ordered by CloudSearch's rank score.\n\n### Using the serach helper mixin\n\nGiven an arbitrary model that uses `ActiveRecord`. You gain search capibilities by `include`ing `Rawscsi::Searchable`:\n\n```ruby\nclass User \u003c ActiveRecord::Base\n  include Rawscsi::Searchable\nend\n```\n\n### Searching\n\n```ruby\nsearch_songs_helper.search('nick drake')\n  =\u003e [#\u003cSong id:156, artist_id: 13423, title: \"Hazey Jane II\"\u003e,\n      #\u003cSong id:342, artist_id: 13423, title: \"One of These Things First\"\u003e]\n```\n\nYou can also add boolean conditions. This query only selects radiohead songs that are b-sides. Note this assumes in the good_songs search domain, there is a boolean field named \"b_side\".\n\n```ruby\nsearch_songs_helper.search('radiohead', :bq =\u003e \"b_side:1\")\n  =\u003e [#\u003cSong id:176, artist_id: 3423, title: \"Meeting in the Aisle\"\u003e..]\n```\n\nHere's how you limit the results:\n\n```ruby\nsearch_songs_helper.search('nick drake', :limit =\u003e 3)\n```\n\nDates are a common constraint. Note the date index on cloud search must be a Unix timestamp integer.\n\n```ruby\nsearch_songs_helper.search('lorde',\n  :date =\u003e {:name =\u003e 'release_date',\n    :from =\u003e 10.months.ago, :to =\u003e Time.now})\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmschae%2Frawscsi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmschae%2Frawscsi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmschae%2Frawscsi/lists"}