Skip to content

Commit

Permalink
Merge pull request #15 from brino/master
Browse files Browse the repository at this point in the history
Added configable search index
  • Loading branch information
joedawson authored Jun 13, 2017
2 parents fb8925b + 29f7efd commit 256fca6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions config/amazon.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
/**
* Preferred response group
*/
'response_group' => env('AMAZON_RESPONSE_GROUP', 'Images,ItemAttributes')
'response_group' => env('AMAZON_RESPONSE_GROUP', 'Images,ItemAttributes'),

/**
* Preferred search index
*/
'search_index' => env('AMAZON_SEARCH_INDEX', 'All'),

];

];
4 changes: 2 additions & 2 deletions src/AmazonECS.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct()
public function search($query)
{
$query = rawurlencode($query);
$params = $this->params(['Keywords' => $query, 'SearchIndex' => 'All', 'ResponseGroup' => $this->response_group]);
$params = $this->params(['Keywords' => $query, 'SearchIndex' => config('amazon.search_index'), 'ResponseGroup' => $this->response_group]);
$string = $this->buildString($params);
$signature = $this->signString($string);
$url = $this->url($params, $signature);
Expand Down Expand Up @@ -134,4 +134,4 @@ private function validConfig()
);
}
}
}
}

0 comments on commit 256fca6

Please sign in to comment.