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-1.1.0 lib/libis/services/search_factory.rb
libis-services-1.0.13 lib/libis/services/search_factory.rb
libis-services-1.0.12 lib/libis/services/search_factory.rb
libis-services-1.0.11 lib/libis/services/search_factory.rb
libis-services-1.0.10 lib/libis/services/search_factory.rb
libis-services-1.0.7 lib/libis/services/search_factory.rb
libis-services-1.0.6 lib/libis/services/search_factory.rb
libis-services-1.0.5 lib/libis/services/search_factory.rb
libis-services-1.0.2 lib/libis/services/search_factory.rb
libis-services-1.0.1 lib/libis/services/search_factory.rb
libis-services-1.0.0 lib/libis/services/search_factory.rb
libis-services-0.2.1 lib/libis/services/search_factory.rb
libis-services-0.2.0 lib/libis/services/search_factory.rb
libis-services-0.1.18 lib/libis/services/search_factory.rb
libis-services-0.1.17 lib/libis/services/search_factory.rb
libis-services-0.1.16 lib/libis/services/search_factory.rb
libis-services-0.1.15 lib/libis/services/search_factory.rb
libis-services-0.1.14 lib/libis/services/search_factory.rb
libis-services-0.1.13 lib/libis/services/search_factory.rb
libis-services-0.1.12 lib/libis/services/search_factory.rb