Sha256: 825b00795e2423e5a23b32fb5f33e6876f52f0ab833a25c025ce84c59c3d371c

Contents?: true

Size: 927 Bytes

Versions: 14

Compression:

Stored size: 927 Bytes

Contents

#!/usr/bin/env ruby

lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require "inquisitio"

# Perform a search containing a boolean query against AWS CloudSearch
#
# example usage:
#
# ruby ./bin/search <enddpoint> "Star Wars" "genre" "Animation" "title"

endpoint = ARGV[0]
query = ARGV[1]
filter_name = ARGV[2]
filter_value =  ARGV[3]
return_fields = [ ARGV[4] ]

Inquisitio.config do |config|
  config.search_endpoint = endpoint
end

puts Inquisitio.search(query,
                       { filter_name.to_sym => filter_value.to_sym, 
                         :arguments => { :facet => 'genre',
                                         'facet-genre-constraints' => 'Animation',
                                         'facet-genre-top-n' => '5'
                                       },
                         :return_fields => return_fields
                       } )

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
inquisitio-1.1.0 bin/facet_query
inquisitio-1.0.0 bin/facet_query
inquisitio-0.2.0 bin/facet_query
inquisitio-0.1.7 bin/facet_query
inquisitio-0.1.6 bin/facet_query
inquisitio-0.1.5 bin/facet_query
inquisitio-0.1.4 bin/facet_query
inquisitio-0.1.3 bin/facet_query
inquisitio-0.1.2 bin/facet_query
inquisitio-0.1.1 bin/facet_query
inquisitio-0.1.0 bin/facet_query
inquisitio-0.0.13 bin/facet_query
inquisitio-0.0.12 bin/facet_query
inquisitio-0.0.11 bin/facet_query