GithubHelp home page GithubHelp logo

aaw / sunspot_mongo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from derekharmel/sunspot_mongo

1.0 2.0 1.0 130 KB

Sunspot search support for Mongo Mapper and Mongoid.

License: MIT License

Ruby 100.00%

sunspot_mongo's Introduction

Installation

Mongo Mapper

Put the following in your Gemfile:

gem 'bson_ext'
gem 'mongo_mapper'
gem 'sunspot_mongo'

Then run:

rails g mongo_mapper:config
rails g sunspot_rails:install
rake sunspot:solr:start

Mongoid

gem 'bson_ext'
gem 'mongoid'
gem 'sunspot_mongo'

Then run:

rails g mongoid:config
rails g sunspot_rails:install
rake sunspot:solr:start

Usage

Add the following to your model (assuming you have a string field named “content”):

include Sunspot::Mongo
searchable do
  text :content
end

Then search like usual:

search = Article.search do
  fulltext "something interesting"
end
search.results

Note: Mongoid adds Article.search, use Article.solr_search instead.

More info

See the Sunspot documentation.

Compatibility

This gem has been tested against Ruby 1.9.2 and Rails 3.1, although it should work with older versions.

Credit

Based on sunspot_mongoid by jugyo. Originally developed by balexand.

sunspot_mongo's People

Contributors

aaw avatar balexand avatar derekharmel avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

joeyaghion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.