No commit activity in last 3 years
No release in over 3 years
Use SQL to query search engines and APIs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Structured Search Build Status Coverage Status

StructuredSearch is a Rubygem for querying search engines, APIs and other information providers by using SQL statements (Yeah, just like the ones you use in mySQL! ...kinda)

  • Supports multiple search terms with multiple search providers
  • Customisable provider configurations allow for modifiable COUNT, MAX, MIN methods.

Installing StructuredSearch

$ gem install structured_search

or in your Gemfile:

gem 'structured_search'

How to use StructuredSearch

There are two path you can go by, the easiest method is to just pass your input and your list of providers into the evaluate method:

    require 'structured_search'

    # a hash of your providers, the key should be the same case as
    # seen in your input, and the values are classes that contain the
    # class method 'search'.
    providers = {
      :Google => MySearchProviders::GoogleSearchClass,
      :Github => GithubApi::StructuredSearchProviderClass
    }

    # the SQL string to evaluate
    search_query = "SELECT 'Matz', 'Ruby' FROM 'Google';"

    results = StructuredSearch.evaluate(search_query, providers)

    # and read your results:
    # they're contained in an array (each statement), addressed by
    # the provider (i.e. Google) and then by search term
    ruby_google_results = results[0]['Google']['Ruby']

License

MIT

About StructuredSearch

Developed by Matt Ryder, please email/tweet me if you see anything missing or erroneous about StructuredSearch.