我正在尝试从rails控制台使用AWS cloudsearch。
示例:
aws.config.update({region:“US-West-2”,凭据:AWS::Credentials.new(“key_id”,“secret_key”),})
csd=AWS::CloudSearchDomain::Client.new(区域:“US-East-1”,endpoint:“http://search-endpoint.us-East-1.CloudSearch.amazonaws.com/”)
1.9.3-p551 :075 > csd.search(query:'user*') # WORKED
=> #<struct Aws::CloudSearchDomain::Types::SearchResponse status=#<struct Aws::CloudSearchDomain::Types::SearchStatus timems=1, rid="z7vRxOYpgKEBCluMDg==">, hits=#<struct Aws::CloudSearchDomain::Types::Hits found=0, start=0, cursor=nil, hit=[]>, facets=nil>
1.9.3-p551 :076 > csd.search(query:'user*', queryParser:'simple') # NOT WORKING
ArgumentError: unexpected value at params[:queryParser]
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/aws-sdk-core/param_validator.rb:26:in `validate!'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/aws-sdk-core/param_validator.rb:11:in `validate!'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/aws-sdk-core/plugins/param_validator.rb:20:in `call'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/aws-sdk-core/plugins/param_converter.rb:21:in `call'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/aws-sdk-core/plugins/response_paging.rb:26:in `call'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/seahorse/client/plugins/response_target.rb:18:in `call'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/seahorse/client/request.rb:70:in `send_request'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/aws-sdk-core-2.1.2/lib/seahorse/client/base.rb:207:in `block (2 levels) in define_operation_methods'
from (irb):76
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/railties-4.2.3/lib/rails/commands/console.rb:110:in `start'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/railties-4.2.3/lib/rails/commands/console.rb:9:in `start'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `block in require'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:274:in `require'
from /Users/anshulgoyal/workspace/adamantium/backend/truckfinder_service/bin/rails:8:in `<top (required)>'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/anshulgoyal/.rvm/gems/ruby-1.9.3-p551/gems/activesupport-4.2.3/lib/active_support/dependencies.rb:268:in `load'
from /Users/anshulgoyal/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/anshulgoyal/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
此外,如果有人能提供一些使用AWS Cloudsearch ruby SDK的代码示例,这将会有所帮助。
谢谢,安舒尔
它应该是query_parser
而不是queryparser
。
下面是您应该查看的文档:http://docs.aws.amazon.com/sdkforruby/api/aws/cloudsearchdomain/client.html
问题内容: 我正在使用predis并订阅了频道并进行监听,它抛出错误并死了,如下图所示,过了60秒后,肯定不是我的Web服务器错误或超时。 目前正在讨论的一个类似的问题在这里。无法得到太多。 我尝试将predis conf文件中的connection_timeout设置为0,但没有太大帮助。 另外,如果我继续使用(向其发送数据并进行处理)该工作程序,则不会出现任何错误。因此,它可能在某处超时,并且
所以我有一个带有shell_exec命令的index.php文件,当我在ubuntu的终端上运行它时,它工作得很好,但是当上传到命名堆托管时,它就不工作了。 http://www.logh.info/这里是网站,是的,我100%确定的路径,以该网站。sh文件是正确的
问题内容: 在使用树集时,我发现了非常奇怪的行为。 根据我的理解,以下程序应打印两条相同的行: 但奇怪的是它打印: 我无法理解-为什么树集的行为如此? 问题答案: 发生这种情况是因为SortedSet的Comparator用于排序,但是removeAll依赖于每个元素的方法。从SortedSet文档中: 请注意,如果排序集要正确实现接口,则排序集(无论是否提供显式比较器)所维护的顺序必须 与equ
因此,在迁移到其他主机,导出和导入数据库,修复链接后,我得到了一些奇怪的php输出,该输出在以前的主机上运行良好。 php连接: php数据库调用: html格式的输出: '; } echo“”;echo“”;如果($row['priceMax']){echo'';}elseif($row['price']){echo'';}$firstRow=0;}}? 有人能解释这里到底出了什么问题吗?我不知
这个程序应该做什么, 我希望它显示一个空白屏幕,直到我在键盘上点击任何字符。但是它做的事情很奇怪。它显示我按的任何东西。它永远不会终止,直到我按下回车键。 据我所知,getchar()应该只读取一个字符。它不应该输出任何东西。 为什么它打印我输入的每个字符? 编辑: 为什么 getchar() 在读取一个字符后不停止,例如在这段代码中: 程序应在读取一个字符后打印完成。
问题内容: 如何为基于Spring的@Scheduled cron作业配置时区? 背景: 我有一份使用Spring的注释每天执行一次的工作,例如下午2点: 问题是2PM在不同服务器之间不同,因为Spring在 内部使用。此外,JavaDoc中的 规定: 获取此主机的默认TimeZone。默认TimeZone的来源可能会因实现方式而异。 换句话说,未确定时区。它可能取决于JVM实现,服务器时区配置,