|
6 | 6 |
|
7 | 7 | class SettingsTest extends AlgoliaIntegrationTestCase |
8 | 8 | { |
9 | | - private $settings = array( |
10 | | - 'searchableAttributes' => array('attribute1', 'attribute2', 'attribute3', 'ordered(attribute4)', 'unordered(attribute5)'), |
11 | | - 'attributesForFaceting' => array('attribute1', 'filterOnly(attribute2)', 'searchable(attribute3)'), |
12 | | - 'unretrievableAttributes' => array('attribute1', 'attribute2'), |
13 | | - 'attributesToRetrieve' => array('attribute3', 'attribute4'), |
14 | | - 'ranking' => array('asc(attribute1)', 'desc(attribute2)', 'attribute', 'custom', 'exact', 'filters', 'geo', 'proximity', 'typo', 'words'), |
15 | | - 'customRanking' => array('asc(attribute1)', 'desc(attribute1)'), |
16 | | - 'replicas' => array('main_replica1', 'main_replica2'), |
17 | | - 'maxValuesPerFacet' => 100, |
18 | | - 'sortFacetValuesBy' => 'count', |
19 | | - 'attributesToHighlight' => array('attribute1', 'attribute2'), |
20 | | - 'attributesToSnippet' => array('attribute1:10', 'attribute2:8'), |
21 | | - 'highlightPreTag' => '<strong>', |
22 | | - 'highlightPostTag' => '</strong>', |
23 | | - 'snippetEllipsisText' => ' and so on.', |
24 | | - 'restrictHighlightAndSnippetArrays' => true, |
25 | | - 'hitsPerPage' => 42, |
26 | | - 'paginationLimitedTo' => 43, |
27 | | - 'minWordSizefor1Typo' => 2, |
28 | | - 'minWordSizefor2Typos' => 6, |
29 | | - 'typoTolerance' => 'false', |
30 | | - 'allowTyposOnNumericTokens' => false, |
31 | | - 'ignorePlurals' => true, |
32 | | - 'disableTypoToleranceOnAttributes' => array('attribute1', 'attribute2'), |
33 | | - 'disableTypoToleranceOnWords' => array('word1', 'word2'), |
34 | | - 'separatorsToIndex' => '()array()(', |
35 | | - 'queryType' => 'prefixNone', |
36 | | - 'removeWordsIfNoResults' => 'allOptional', |
37 | | - 'advancedSyntax' => true, |
38 | | - 'optionalWords' => array('word1', 'word2'), |
39 | | - 'removeStopWords' => true, |
40 | | - 'disablePrefixOnAttributes' => array('attribute1', 'attribute2'), |
41 | | - 'disableExactOnAttributes' => array('attribute1', 'attribute2'), |
42 | | - 'exactOnSingleWordQuery' => 'word', |
43 | | - 'enableRules' => false, |
44 | | - 'numericAttributesForFiltering' => array('attribute1', 'attribute2'), |
45 | | - 'allowCompressionOfIntegerArray' => true, |
46 | | - 'attributeForDistinct' => 'attribute1', |
47 | | - 'distinct' => 2, |
48 | | - 'replaceSynonymsInHighlight' => false, |
49 | | - 'minProximity' => 7, |
50 | | - 'responseFields' => array('hits', 'hitsPerPage'), |
51 | | - 'maxFacetHits' => 100, |
52 | | - 'camelCaseAttributes' => array('attribute1', 'attribute2'), |
53 | | - 'decompoundedAttributes' => array('de' => array('attribute1', 'attribute2'), 'fi' => array('attribute3')), |
54 | | - 'keepDiacriticsOnCharacters' => 'øé', |
55 | | - ); |
| 9 | + private $settings = array(); |
56 | 10 |
|
57 | 11 | protected function setUp() |
58 | 12 | { |
59 | 13 | parent::setUp(); |
60 | 14 |
|
61 | | - if (!isset(static::$indexes['main'])) { |
| 15 | + if (! isset(static::$indexes['main'])) { |
| 16 | + static::$indexes['main_replica_1'] = self::safeName('settings-mgmt-replica-1'); |
| 17 | + static::$indexes['main_replica_2'] = self::safeName('settings-mgmt-replica-2'); |
62 | 18 | static::$indexes['main'] = self::safeName('settings-mgmt'); |
63 | 19 | } |
| 20 | + |
| 21 | + $this->settings = array( |
| 22 | + 'searchableAttributes' => array('attribute1', 'attribute2', 'attribute3', 'ordered(attribute4)', 'unordered(attribute5)'), |
| 23 | + 'attributesForFaceting' => array('attribute1', 'filterOnly(attribute2)', 'searchable(attribute3)'), |
| 24 | + 'unretrievableAttributes' => array('attribute1', 'attribute2'), |
| 25 | + 'attributesToRetrieve' => array('attribute3', 'attribute4'), |
| 26 | + 'ranking' => array('asc(attribute1)', 'desc(attribute2)', 'attribute', 'custom', 'exact', 'filters', 'geo', 'proximity', 'typo', 'words'), |
| 27 | + 'customRanking' => array('asc(attribute1)', 'desc(attribute1)'), |
| 28 | + 'replicas' => array(static::$indexes['main_replica_1'], static::$indexes['main_replica_2']), |
| 29 | + 'maxValuesPerFacet' => 100, |
| 30 | + 'sortFacetValuesBy' => 'count', |
| 31 | + 'attributesToHighlight' => array('attribute1', 'attribute2'), |
| 32 | + 'attributesToSnippet' => array('attribute1:10', 'attribute2:8'), |
| 33 | + 'highlightPreTag' => '<strong>', |
| 34 | + 'highlightPostTag' => '</strong>', |
| 35 | + 'snippetEllipsisText' => ' and so on.', |
| 36 | + 'restrictHighlightAndSnippetArrays' => true, |
| 37 | + 'hitsPerPage' => 42, |
| 38 | + 'paginationLimitedTo' => 43, |
| 39 | + 'minWordSizefor1Typo' => 2, |
| 40 | + 'minWordSizefor2Typos' => 6, |
| 41 | + 'typoTolerance' => 'false', |
| 42 | + 'allowTyposOnNumericTokens' => false, |
| 43 | + 'ignorePlurals' => true, |
| 44 | + 'disableTypoToleranceOnAttributes' => array('attribute1', 'attribute2'), |
| 45 | + 'disableTypoToleranceOnWords' => array('word1', 'word2'), |
| 46 | + 'separatorsToIndex' => '()array()(', |
| 47 | + 'queryType' => 'prefixNone', |
| 48 | + 'removeWordsIfNoResults' => 'allOptional', |
| 49 | + 'advancedSyntax' => true, |
| 50 | + 'optionalWords' => array('word1', 'word2'), |
| 51 | + 'removeStopWords' => true, |
| 52 | + 'disablePrefixOnAttributes' => array('attribute1', 'attribute2'), |
| 53 | + 'disableExactOnAttributes' => array('attribute1', 'attribute2'), |
| 54 | + 'exactOnSingleWordQuery' => 'word', |
| 55 | + 'enableRules' => false, |
| 56 | + 'numericAttributesForFiltering' => array('attribute1', 'attribute2'), |
| 57 | + 'allowCompressionOfIntegerArray' => true, |
| 58 | + 'attributeForDistinct' => 'attribute1', |
| 59 | + 'distinct' => 2, |
| 60 | + 'replaceSynonymsInHighlight' => false, |
| 61 | + 'minProximity' => 7, |
| 62 | + 'responseFields' => array('hits', 'hitsPerPage'), |
| 63 | + 'maxFacetHits' => 100, |
| 64 | + 'camelCaseAttributes' => array('attribute1', 'attribute2'), |
| 65 | + 'decompoundedAttributes' => array('de' => array('attribute1', 'attribute2'), 'fi' => array('attribute3')), |
| 66 | + 'keepDiacriticsOnCharacters' => 'øé', |
| 67 | + ); |
64 | 68 | } |
65 | 69 |
|
66 | 70 | public function testSettings() |
|
0 commit comments