Sha256: 542221c59d20dceb9e1f03d26e564bfb2e232fdcb654b9da3ccfc21d89504a72

Contents?: true

Size: 852 Bytes

Versions: 31

Compression:

Stored size: 852 Bytes

Contents

# coding: utf-8

require_relative 'aleph/search'
require_relative 'primo/search'
require_relative 'sharepoint/search'
require_relative 'scope/search'

module Libis
  module Services

    class SearchFactory
      def initialize(format, *args)
        @search_class = self.class.const_get("Libis::Services::#{format}::Search")
        @search_client = @search_class.new *args

      rescue Exception => e
        puts e.message
        exit -1
      end

      def query(query, options = {})
        @search_client.get(query, options)
      end

      def find(term, options = {})
        @search_client.find(term, options)
      end

      def each(options = {}, &block)
        @search_client.each(options, &block)
      end

      def next_record(options = {}, &block)
        @search_client.next_record(options, &block)
      end

    end

  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
libis-services-0.1.11 lib/libis/services/search_factory.rb
libis-services-0.1.10 lib/libis/services/search_factory.rb
libis-services-0.1.9 lib/libis/services/search_factory.rb
libis-services-0.1.7 lib/libis/services/search_factory.rb
libis-services-0.1.5 lib/libis/services/search_factory.rb
libis-services-0.1.3 lib/libis/services/search_factory.rb
libis-services-0.1.2 lib/libis/services/search_factory.rb
libis-services-0.1.1 lib/libis/services/search_factory.rb
libis-services-0.1.0-java lib/libis/services/search_factory.rb
libis-services-0.0.3 lib/libis/services/search_factory.rb
libis-services-0.0.2 lib/libis/services/search_factory.rb