Completed
Push — dev2 ( cc8d6e...f0efe9 )
by Gordon
03:05
created
searchpage/ElasticSearchPage.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	);
63 63
 
64 64
 	private static $many_many_extraFields = array(
65
-    	'ElasticaSearchableFields' => array(
65
+		'ElasticaSearchableFields' => array(
66 66
 		'Searchable' => 'Boolean', // allows the option of turning off a single field for searching
67 67
 		'SimilarSearchable' => 'Boolean', // allows field to be used in more like this queries.
68 68
 		'Active' => 'Boolean', // preserve previous edits of weighting when classes changed
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
 		$sortedWords = $this->SimilarityStopWords;
105 105
 
106 106
 		$stopwordsField = StringTagField::create(
107
-		    'SimilarityStopWords',
108
-		    'Stop Words for Similar Search',
109
-		    $sortedWords,
110
-		    $sortedWords
107
+			'SimilarityStopWords',
108
+			'Stop Words for Similar Search',
109
+			$sortedWords,
110
+			$sortedWords
111 111
 		);
112 112
 
113 113
 		$stopwordsField->setShouldLazyLoad(true); // tags should be lazy loaded
@@ -190,15 +190,15 @@  discard block
 block discarded – undo
190 190
 		$fields->addFieldToTab('Root.Search.Aggregations', new TextField('SearchHelper',
191 191
 			'ClassName of object to manipulate search details and results.  Leave blank for standard search'));
192 192
 
193
-        $ottos = AutoCompleteOption::get()->Filter('Locale', $this->Locale)->map('ID', 'Name')->
194
-        									toArray();
195
-        $df = DropdownField::create('AutoCompleteFunctionID', 'Autocomplete Function')->
196
-        							setSource($ottos);
197
-        $df->setEmptyString('-- Please select what do do after find as you type has occurred --');
193
+		$ottos = AutoCompleteOption::get()->Filter('Locale', $this->Locale)->map('ID', 'Name')->
194
+											toArray();
195
+		$df = DropdownField::create('AutoCompleteFunctionID', 'Autocomplete Function')->
196
+									setSource($ottos);
197
+		$df->setEmptyString('-- Please select what do do after find as you type has occurred --');
198 198
 
199
-        $ottos = $this->ElasticaSearchableFields()->filter('EnableAutocomplete',1)->Map('ID', 'Name')->toArray();
200
-        $autoCompleteFieldDF = DropDownField::create('AutoCompleteFieldID', 'Field to use for autocomplete')->setSource($ottos);
201
-        $autoCompleteFieldDF->setEmptyString('-- Please select which field to use for autocomplete --');
199
+		$ottos = $this->ElasticaSearchableFields()->filter('EnableAutocomplete',1)->Map('ID', 'Name')->toArray();
200
+		$autoCompleteFieldDF = DropDownField::create('AutoCompleteFieldID', 'Field to use for autocomplete')->setSource($ottos);
201
+		$autoCompleteFieldDF->setEmptyString('-- Please select which field to use for autocomplete --');
202 202
 
203 203
 		$fields->addFieldToTab("Root.Search.AutoComplete",
204 204
 		  		FieldGroup::create(
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		$pickerConfig->removeComponentsByType(new PickerFieldAddExistingSearchButton());
224 224
 		$pickerConfig->getComponentByType('GridFieldPaginator')->setItemsPerPage(100);
225 225
 
226
-        $searchPicker->enableEdit();
226
+		$searchPicker->enableEdit();
227 227
 		$edittest = $pickerConfig->getComponentByType('GridFieldDetailForm');
228 228
 		$edittest->setFields(FieldList::create(
229 229
 			TextField::create('Name', 'Field Name'),
@@ -257,23 +257,23 @@  discard block
 block discarded – undo
257 257
 
258 258
 		// What do display on the grid of searchable fields
259 259
 		$dataColumns = $pickerConfig->getComponentByType('GridFieldDataColumns');
260
-        $dataColumns->setDisplayFields(array(
260
+		$dataColumns->setDisplayFields(array(
261 261
 			'Name' => 'Name',
262
-        	'ClazzName' => 'Class',
262
+			'ClazzName' => 'Class',
263 263
 			'Type' => 'Type',
264 264
 			'Searchable' => 'Use for Search?',
265 265
 			'SimilarSearchable' => 'Use for Similar Search?',
266 266
 			'ShowHighlights' => 'Show Search Highlights',
267 267
 			'Weight' => 'Weighting'
268
-        ));
268
+		));
269 269
 
270 270
 		return $fields;
271 271
 	}
272 272
 
273 273
 
274 274
 	public function getCMSValidator() {
275
-        return new ElasticSearchPage_Validator();
276
-    }
275
+		return new ElasticSearchPage_Validator();
276
+	}
277 277
 
278 278
 
279 279
 	/**
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 		$esfs = $this->ElasticaSearchableFields();
359 359
 
360 360
 		// Remove existing searchable fields for this page from the list of all available
361
-    	$delta = array_keys($esfs->map()->toArray());
361
+		$delta = array_keys($esfs->map()->toArray());
362 362
 		$newSearchableFields = $sfs->exclude('ID', $delta);
363 363
 
364 364
 		if ($newSearchableFields->count() > 0) {
Please login to merge, or discard this patch.
searchpage/ElasticSearchPage_Controller.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 		Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
11 11
 		Requirements::javascript("elastica/javascript/jquery.autocomplete.js");
12 12
 		Requirements::javascript("elastica/javascript/elastica.js");
13
-        Requirements::css("elastica/css/elastica.css");
13
+		Requirements::css("elastica/css/elastica.css");
14 14
 	}
15 15
 
16 16
 
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 
85 85
 		try {
86 86
 			// Simulate server being down for testing purposes
87
-	        if (isset($_GET['ServerDown'])) {
88
-	        	throw new Elastica\Exception\Connection\HttpException('Unable to reach search server');
89
-	        }
87
+			if (isset($_GET['ServerDown'])) {
88
+				throw new Elastica\Exception\Connection\HttpException('Unable to reach search server');
89
+			}
90 90
 			if (class_exists($class)) {
91 91
 				$instance = \DataObject::get_by_id($class,$instanceID);
92 92
 
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
 		$paginated = null;
227 227
 		try {
228 228
 			// Simulate server being down for testing purposes
229
-	        if (isset($_GET['ServerDown'])) {
230
-	        	throw new Elastica\Exception\Connection\HttpException('Unable to reach search server');
231
-	        }
229
+			if (isset($_GET['ServerDown'])) {
230
+				throw new Elastica\Exception\Connection\HttpException('Unable to reach search server');
231
+			}
232 232
 
233 233
 			// now actually perform the search using the original query
234 234
 			$paginated = $es->search($queryText, $fieldsToSearch, $testMode);
Please login to merge, or discard this patch.