forked from collective/collective.solr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
better-defaults.diff
151 lines (145 loc) · 6.08 KB
/
better-defaults.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
diff --git a/src/collective/solr/profiles/default/solr.xml b/src/collective/solr/profiles/default/solr.xml
index dcd2716..907be7a 100644
--- a/src/collective/solr/profiles/default/solr.xml
+++ b/src/collective/solr/profiles/default/solr.xml
<settings>
- <async value="False" />
- <index-timeout value="0" />
- <search-timeout value="0" />
+ <async value="True" />
+ <auto-commit value="False" />
+ <commit-within value="30000" />
+ <index-timeout value="30.0" />
+ <search-timeout value="30.0" />
<max-results value="0" />
<required-query-parameters>
<parameter name="SearchableText" />
+ <parameter name="Description" />
+ <parameter name="facet" />
</required-query-parameters>
<filter-query-parameters>
+ <parameter name="allowedRolesAndUsers effective expires" />
+ <parameter name="portal_type review_state showinsearch" />
+ <parameter name="allowedRolesAndUsers" />
+ <parameter name="effective" />
+ <parameter name="expires" />
+ <parameter name="is_default_page" />
+ <parameter name="Language" />
+ <parameter name="object_provides" />
+ <parameter name="parentPaths" />
+ <parameter name="path" />
+ <parameter name="physicalDepth" />
<parameter name="portal_type" />
+ <parameter name="review_state" />
+ <parameter name="Type" />
</filter-query-parameters>
- <slow-query-threshold value="0" />
- <effective-steps value="1" />
+ <slow-query-threshold value="1000" />
+ <effective-steps value="900" />
<exclude-user value="False" />
</settings>
</object>
diff --git a/src/collective/solr/tests/configlet.txt b/src/collective/solr/tests/configlet.txt
index 739c36c..66d94e8 100644
--- a/src/collective/solr/tests/configlet.txt
+++ b/src/collective/solr/tests/configlet.txt
>>> config.base
'/solr'
- >>> config.async
- False
- >>> config.auto_commit
- True
- >>> config.commit_within
- 0
>>> config.index_timeout
- 0.0
+ 30.0
>>> config.search_timeout
- 0.0
+ 30.0
>>> config.max_results
0
>>> config.required
- ('SearchableText',)
+ ('SearchableText', 'Description', 'facet')
>>> config.facets
('portal_type', 'review_state')
- >>> config.filter_queries
- ('portal_type',)
>>> config.slow_query_threshold
- 0
- >>> config.effective_steps
- 1
+ 1000
>>> config.exclude_user
False
@@ -80,8 +68,8 @@ Make some changes
>>> self.browser.getControl(name='form.search_timeout').value = '3.1415'
>>> self.browser.getControl(name='form.max_results').value = '23'
>>> self.browser.getControl(name='form.required.0.').value = 'foo'
- >>> self.browser.getControl(name='form.required.add').click()
>>> self.browser.getControl(name='form.required.1.').value = 'bar'
+ >>> self.browser.getControl(name='form.required.2.').value = 'baz'
>>> self.browser.getControl(name='form.search_pattern').value = '(Title:{value})'
>>> self.browser.getControl(name='form.facets.0.').value = 'type'
>>> self.browser.getControl(name='form.facets.1.').value = 'state'
@@ -124,7 +112,7 @@ Make sure the changes have been applied correctly to the tool:
>>> config.max_results
23
>>> config.required
- [u'foo', u'bar']
+ [u'foo', u'bar', u'baz']
>>> config.search_pattern
u'(Title:{value})'
>>> config.facets
@@ -144,12 +132,13 @@ correct host and port:
>>> self.browser.getControl(name='form.port').value = '8983'
>>> self.browser.getControl(name="form.actions.save").click()
- >>> self.browser.getControl(name='form.filter_queries.add').click()
>>> self.browser.getControl(name='form.filter_queries.0.').value = 'Subject'
>>> self.browser.getControl(name='form.filter_queries.1.').value = 'review_state'
>>> self.browser.getControl(name="form.actions.save").click()
- >>> sorted(config.filter_queries)
- [u'Subject', u'review_state']
+ >>> u'Subject' in config.filter_queries
+ True
+ >>> u'review_state' in config.filter_queries
+ True
Required query parameters
@@ -162,6 +151,7 @@ to an empty list (please see `issue #18`__ for more infos):
>>> self.browser.getControl(name='form.required.remove_0').value = True
>>> self.browser.getControl(name='form.required.remove_1').value = True
+ >>> self.browser.getControl(name='form.required.remove_2').value = True
>>> self.browser.getControl(name='form.required.remove').click()
>>> self.browser.getControl(name="form.actions.save").click()
>>> 'Changes saved.' in self.browser.contents
diff --git a/src/collective/solr/tests/test_exportimport.py b/src/collective/solr/tests/test_exportimport.py
index 57ab50c..5d62259 100644
--- a/src/collective/solr/tests/test_exportimport.py
+++ b/src/collective/solr/tests/test_exportimport.py
self.assertEqual(config.host, '127.0.0.1')
self.assertEqual(config.port, 8983)
self.assertEqual(config.base, '/solr')
- self.assertEqual(config.async, False)
- self.assertEqual(config.auto_commit, True)
- self.assertEqual(config.commit_within, 1000)
- self.assertEqual(config.index_timeout, 0)
- self.assertEqual(config.search_timeout, 0)
+ self.assertEqual(config.async, True)
+ self.assertEqual(config.auto_commit, False)
+ self.assertEqual(config.commit_within, 30000)
+ self.assertEqual(config.index_timeout, 30.0)
+ self.assertEqual(config.search_timeout, 30.0)
self.assertEqual(config.max_results, 0)
- self.assertEqual(config.required, ('SearchableText', ))
+ self.assertEqual(config.required,
+ ('SearchableText', 'Description', 'facet'))
self.assertEqual(config.facets, ('portal_type', 'review_state'))
- self.assertEqual(config.filter_queries, ('portal_type', ))
- self.assertEqual(config.slow_query_threshold, 0)
- self.assertEqual(config.effective_steps, 1)
+ self.assertEqual(config.slow_query_threshold, 1000)
+ self.assertEqual(config.effective_steps, 900)
self.assertEqual(config.exclude_user, False)
def testExportStep(self):