@@ -510,6 +510,30 @@ public function search($query, $args = null)
510510        );
511511    }
512512
513+     /** 
514+      * Perform a search inside facets. 
515+      * 
516+      * @param $facetName 
517+      * @param $facetQuery 
518+      * @param array $query 
519+      * @return mixed 
520+      */ 
521+     public  function  searchFacet ($ facetName$ facetQuery$ queryarray ())
522+     {
523+         $ query'facetQuery ' ] = $ facetQuery
524+ 
525+         return  $ this client ->request (
526+             $ this context ,
527+             'POST ' ,
528+             '/1/indexes/ ' .$ this urlIndexName .'/facets/ ' .$ facetName'/query ' ,
529+             array (),
530+             array ('params '  => $ this client ->buildQuery ($ query
531+             $ this context ->readHostsArray ,
532+             $ this context ->connectTimeout ,
533+             $ this context ->searchTimeout 
534+         );
535+     }
536+ 
513537    /** 
514538     * Perform a search with disjunctive facets generating as many queries as number of disjunctive facets. 
515539     * 
@@ -741,7 +765,7 @@ public function clearIndex()
741765     *                        - attributesToSnippet**: (array of strings) default list of attributes to snippet alongside the 
742766     *                        number of words to return (syntax is attributeName:nbWords). By default no snippet is computed. 
743767     *                        If set to null, no snippet is computed. 
744-      *                        - attributesToIndex: (array of strings) the list of fields you want to index. 
768+      *                        - searchableAttributes (formerly named  attributesToIndex) : (array of strings) the list of fields you want to index. 
745769     *                        If set to null, all textual and numerical attributes of your objects are indexed, but you 
746770     *                        should update it to get optimal results. This parameter has two important uses: 
747771     *                        - Limit the attributes to index: For example if you store a binary image in base64, you want to 
@@ -750,7 +774,7 @@ public function clearIndex()
750774     *                        attributes at the beginning of the list will be considered more important than matches in 
751775     *                        attributes further down the list. In one attribute, matching text at the beginning of the 
752776     *                        attribute will be considered more important than text after, you can disable this behavior if 
753-      *                        you add your attribute inside `unordered(AttributeName)`, for example attributesToIndex : 
777+      *                        you add your attribute inside `unordered(AttributeName)`, for example searchableAttributes : 
754778     *                        ["title", "unordered(text)"]. 
755779     *                        - attributesForFaceting: (array of strings) The list of fields you want to use for faceting. 
756780     *                        All strings in the attribute selected for faceting are extracted and added as a facet. If set 
@@ -765,7 +789,7 @@ public function clearIndex()
765789     *                        - typo: sort according to number of typos, 
766790     *                        - geo: sort according to decreassing distance when performing a geo-location based search, 
767791     *                        - proximity: sort according to the proximity of query words in hits, 
768-      *                        - attribute: sort according to the order of attributes defined by attributesToIndex , 
792+      *                        - attribute: sort according to the order of attributes defined by searchableAttributes , 
769793     *                        - exact: 
770794     *                        - if the user query contains one word: sort objects having an attribute that is exactly the 
771795     *                        query word before others. For example if you search for the "V" TV show, you want to find it 
@@ -789,16 +813,16 @@ public function clearIndex()
789813     *                        - optionalWords: (array of strings) Specify a list of words that should be considered as 
790814     *                        optional when found in the query. 
791815     * 
792-      * @param  bool             $forwardToSlaves  
816+      * @param  bool             $forwardToReplicas  
793817     * @return mixed 
794818     * @throws AlgoliaException 
795819     */ 
796-     public  function  setSettings ($ settings$ forwardToSlaves false )
820+     public  function  setSettings ($ settings$ forwardToReplicas false )
797821    {
798822        $ url'/1/indexes/ ' .$ this urlIndexName .'/settings ' ;
799823
800-         if  ($ forwardToSlaves 
801-             $ url$ url'?forwardToSlaves =true ' ;
824+         if  ($ forwardToReplicas 
825+             $ url$ url'?forwardToReplicas =true ' ;
802826        }
803827
804828        return  $ this client ->request (
@@ -1171,18 +1195,18 @@ public function getSynonym($objectID)
11711195
11721196    /** 
11731197     * @param $objectID 
1174-      * @param $forwardToSlaves  
1198+      * @param $forwardToReplicas  
11751199     * 
11761200     * @return mixed 
11771201     * 
11781202     * @throws AlgoliaException 
11791203     */ 
1180-     public  function  deleteSynonym ($ objectID$ forwardToSlaves false )
1204+     public  function  deleteSynonym ($ objectID$ forwardToReplicas false )
11811205    {
11821206        return  $ this client ->request (
11831207            $ this context ,
11841208            'DELETE ' ,
1185-             '/1/indexes/ ' .$ this urlIndexName .'/synonyms/ ' .urlencode ($ objectID'?forwardToSlaves = ' .($ forwardToSlaves 'true '  : 'false ' ),
1209+             '/1/indexes/ ' .$ this urlIndexName .'/synonyms/ ' .urlencode ($ objectID'?forwardToReplicas = ' .($ forwardToReplicas 'true '  : 'false ' ),
11861210            null ,
11871211            null ,
11881212            $ this context ->writeHostsArray ,
@@ -1192,18 +1216,18 @@ public function deleteSynonym($objectID, $forwardToSlaves = false)
11921216    }
11931217
11941218    /** 
1195-      * @param bool $forwardToSlaves  
1219+      * @param bool $forwardToReplicas  
11961220     * 
11971221     * @return mixed 
11981222     * 
11991223     * @throws AlgoliaException 
12001224     */ 
1201-     public  function  clearSynonyms ($ forwardToSlaves false )
1225+     public  function  clearSynonyms ($ forwardToReplicas false )
12021226    {
12031227        return  $ this client ->request (
12041228            $ this context ,
12051229            'POST ' ,
1206-             '/1/indexes/ ' .$ this urlIndexName .'/synonyms/clear?forwardToSlaves = ' .($ forwardToSlaves 'true '  : 'false ' ),
1230+             '/1/indexes/ ' .$ this urlIndexName .'/synonyms/clear?forwardToReplicas = ' .($ forwardToReplicas 'true '  : 'false ' ),
12071231            null ,
12081232            null ,
12091233            $ this context ->writeHostsArray ,
@@ -1214,20 +1238,20 @@ public function clearSynonyms($forwardToSlaves = false)
12141238
12151239    /** 
12161240     * @param $objects 
1217-      * @param bool $forwardToSlaves  
1241+      * @param bool $forwardToReplicas  
12181242     * @param bool $replaceExistingSynonyms 
12191243     * 
12201244     * @return mixed 
12211245     * 
12221246     * @throws AlgoliaException 
12231247     */ 
1224-     public  function  batchSynonyms ($ objects$ forwardToSlaves false , $ replaceExistingSynonymsfalse )
1248+     public  function  batchSynonyms ($ objects$ forwardToReplicas false , $ replaceExistingSynonymsfalse )
12251249    {
12261250        return  $ this client ->request (
12271251            $ this context ,
12281252            'POST ' ,
12291253            '/1/indexes/ ' .$ this urlIndexName .'/synonyms/batch?replaceExistingSynonyms= ' .($ replaceExistingSynonyms'true '  : 'false ' )
1230-                 .'&forwardToSlaves = ' .($ forwardToSlaves 'true '  : 'false ' ),
1254+                 .'&forwardToReplicas = ' .($ forwardToReplicas 'true '  : 'false ' ),
12311255            null ,
12321256            $ objects
12331257            $ this context ->writeHostsArray ,
@@ -1239,18 +1263,18 @@ public function batchSynonyms($objects, $forwardToSlaves = false, $replaceExisti
12391263    /** 
12401264     * @param $objectID 
12411265     * @param $content 
1242-      * @param bool $forwardToSlaves  
1266+      * @param bool $forwardToReplicas  
12431267     * 
12441268     * @return mixed 
12451269     * 
12461270     * @throws AlgoliaException 
12471271     */ 
1248-     public  function  saveSynonym ($ objectID$ content$ forwardToSlaves false )
1272+     public  function  saveSynonym ($ objectID$ content$ forwardToReplicas false )
12491273    {
12501274        return  $ this client ->request (
12511275            $ this context ,
12521276            'PUT ' ,
1253-             '/1/indexes/ ' .$ this urlIndexName .'/synonyms/ ' .urlencode ($ objectID'?forwardToSlaves = ' .($ forwardToSlaves 'true '  : 'false ' ),
1277+             '/1/indexes/ ' .$ this urlIndexName .'/synonyms/ ' .urlencode ($ objectID'?forwardToReplicas = ' .($ forwardToReplicas 'true '  : 'false ' ),
12541278            null ,
12551279            $ content
12561280            $ this context ->writeHostsArray ,
0 commit comments