File tree Expand file tree Collapse file tree 3 files changed +1
-37
lines changed
Expand file tree Collapse file tree 3 files changed +1
-37
lines changed Original file line number Diff line number Diff line change @@ -1547,28 +1547,6 @@ See [Production Rails](https://github.com/ankane/production_rails) for other goo
15471547
15481548# # Performance
15491549
1550- # ## JSON Generation
1551-
1552- Increase performance with faster JSON generation. Add to your Gemfile:
1553-
1554- ` ` ` ruby
1555- gem "json", ">= 2.10.2"
1556- ` ` `
1557-
1558- And create an initializer with:
1559-
1560- ` ` ` ruby
1561- class SearchSerializer
1562- def dump(object)
1563- JSON.generate(object.as_json)
1564- end
1565- end
1566-
1567- Elasticsearch::API.settings[:serializer] = SearchSerializer.new
1568- # or
1569- OpenSearch::API.settings[:serializer] = SearchSerializer.new
1570- ` ` `
1571-
15721550# ## Persistent HTTP Connections
15731551
15741552Significantly increase performance with persistent HTTP connections. Add [Typhoeus ](https: // github.com/ typhoeus/ typhoeus) to your Gemfile and it’ll automatically be used.
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def dump(object)
1818 end
1919end
2020
21- Elasticsearch ::API . settings [ :serializer ] = SearchSerializer . new
21+ # Elasticsearch::API.settings[:serializer] = SearchSerializer.new
2222# OpenSearch::API.settings[:serializer] = SearchSerializer.new
2323
2424Searchkick . redis = Redis . new
Original file line number Diff line number Diff line change 2323Searchkick . search_timeout = 5
2424Searchkick . index_suffix = ENV [ "TEST_ENV_NUMBER" ] # for parallel tests
2525
26- class SearchSerializer
27- def dump ( object )
28- JSON . generate ( object . as_json )
29- end
30- end
31-
32- if ENV [ "TEST_SERIALIZER" ]
33- if defined? ( Elasticsearch )
34- Elasticsearch ::API . settings [ :serializer ] = SearchSerializer . new
35- else
36- OpenSearch ::API . settings [ :serializer ] = SearchSerializer . new
37- end
38- end
39-
4026puts "Running against #{ Searchkick . opensearch? ? "OpenSearch" : "Elasticsearch" } #{ Searchkick . server_version } "
4127
4228I18n . config . enforce_available_locales = true
You can’t perform that action at this time.
0 commit comments