GithubHelp home page GithubHelp logo

mccolin / do_document_fields Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 108 KB

Add document-style field blobs to any ActiveRecord object. Keep the ActiveRecord and SQL you want for associations, and toss the bulk of data into an on-object document

Home Page: http://mccolin.com/

Ruby 100.00%

do_document_fields's People

Contributors

mccolin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

do_document_fields's Issues

Add Aggregate Function Support

Aggregate query functions average, count, maximum, minimum, and sum should be supported on document fields to aid in reporting run against document field values.

Desired usage for declaring and gathering aggregate support would be:

class MyClass
do_document_fields
document_field :num_friends, :aggregate=>[:average, :count, :sum]
document_field :num_hours, :aggregate=>true # or :aggregate=>:all
end

MyClass.average(:num_friends) => 78 #average number of friends
MyClass.maximum(:num_friends) => Error #method :maximum not declared on num_friends
MyClass.minimum(:num_hours) => 2 #minimum number of hours

Declaration can optionally (additionally?) be supported using a "document_aggregate" method or a variation of the "document_index" method.

Aggregates will be stored using cache-counting within the search index table for the class. This keeps only one support table in the database for both index/finder support and aggregate support.

Document Field indices are not full-text

The index built for values in document fields are currently created as strings, not text, due to index limitations of MySQL and other database implementations.

Full text search is a can of worms for spanning different databases, which will require a bit of redesign for queries, wich support for various database implementations.

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.