Skip to content

Instantly share code, notes, and snippets.

@palin
Last active May 17, 2018 08:19
Show Gist options
  • Save palin/df96c428ec65d832c7c0d0121e8340a6 to your computer and use it in GitHub Desktop.
Save palin/df96c428ec65d832c7c0d0121e8340a6 to your computer and use it in GitHub Desktop.
$ Torque.store('ask_an_owner_questions', data)
=> {
"_index"=>"torque-ask_an_owner_questions",
"_type"=>"document",
"_id"=>"483518",
"_version"=>1,
"result"=>"created",
"_shards"=>{
"total"=>2,
"successful"=>1,
"failed"=>0
},
"created"=>true
}
The data which goes to Torque looks like this:
data =
{
:id=>483518,
:locale=>: "en-GB",
:searchable=>[
{
:id=>483518,
:type=>"AskAnOwnerQuestion",
:value=>"Are you in Australia?"
},
{
:id=>531533,
:type=>"AskAnOwnerResponse",
:value=>"Yes x 1"
}
],
:filterable=>[
{
:key=>"product_group_id",
:value=>71111111
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment