Skip to content

Commit 6c2b1c9

Browse files
committed
fix(Query): The matchPage defaults to 1 (not 0).
- In the backend 0 was always earlier converted to 1, but allowing 0 in the client could give the impression that paging started on 0 and that matchPageNext would yield the next page when it in reality just fetched the same page once more. - Also added some spelling fixes.
1 parent 4695cf5 commit 6c2b1c9

14 files changed

+72
-66
lines changed

GETTING_STARTED.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ The two central classes are [[SearchClient]] and [[Settings]]:
1010

1111
The central class is the [[SearchClient]]. To start using it you will need to create a new instance of it. The constructor takes two parameters, a baseUrl and optionally a settings object.
1212

13-
* The base-url is typically `"http://myserver:9950"` for theIntelliSearch SearchService.
13+
* The base-url is typically `"http://myserver:9950"` for the IntelliSearch SearchService.
1414
* The settings object has properties that help you customize the solution to your needs.
1515
* If you are using the "manual" mode with promises, then you can leave this empty.
1616
* If you want to use the "automatic" mode, then you will have to set up some of these properties.
1717
* Use the settings' version parameter to override the default 3 with 2 (if you are using a v2 backend rest-interface).
1818

1919
### [[Settings]]
2020

21-
The [[Settings]]Settings</a> class holds properties as follows:
21+
The [[Settings]] class holds properties as follows:
2222

2323
* `allCategories`: [[AllCategoriesSettings]]</a>
2424
* `authentication`: [[AuthenticationSettings]]</a>
@@ -63,7 +63,7 @@ In addition the `filters` and `matchPage` properties also have a couple of helpe
6363
* `filterAdd(string filter)`
6464
* `filterRemove(string filter)`
6565
* `matchPageNext()`
66-
* `matcPagePrev()`
66+
* `matchPagePrev()`
6767

6868
### Set up triggers
6969

@@ -157,7 +157,7 @@ The web-service properties are available though (as long as you didn't pass `ena
157157
findLoading = false;
158158
},
159159
triggers: {
160-
queryChanged: true // Means that the match-results will update on queryChanges, and according to the other default trigger values. Still needs minLength and triggerdelay is also obeyed. This example allows a kind of realtime search for matches.
160+
queryChanged: true // Means that the match-results will update on queryChanges, and according to the other default trigger values. Still needs minLength and triggerDelay is also obeyed. This example allows a kind of real-time search for matches.
161161
}
162162
},
163163
categorize: {
@@ -175,7 +175,7 @@ The web-service properties are available though (as long as you didn't pass `ena
175175
categorizeLoading = false;
176176
},
177177
triggers: {
178-
// Here we don't change the triggers. queryChange is false so it will not "autosearch".
178+
// Here we don't change the triggers. queryChange is false so it will not "auto-search".
179179
}
180180
},
181181
autocomplete: {
@@ -232,7 +232,7 @@ If you however want to use authentication, then there are a couple of things tha
232232

233233
1. A web-service that identifies the user must be setup that is accessible from the page that the search-client runs on.
234234
* The web-service endpoint must identify the user and create a JWT that is returned.
235-
* On the server-side the JWT needs to be generated by using the same secret key as is set up in the SearchService (a random key was generated on setup and should be preconfigured).
235+
* On the server-side the JWT needs to be generated by using the same secret key as is set up in the SearchService (a random key was generated on setup and should be pre-configured).
236236
* A choice must be made on the expiration time for the token. It is suggested to be liberal, but to still have an expiration time. An hour would probably be fine in many cases.
237237
* It is suggested that the creation time property in the JWT is backdated with a minute or so to cope for time variances between the SearchService and this web-service.
238238

@@ -242,10 +242,10 @@ If you however want to use authentication, then there are a couple of things tha
242242
If the returned structure is `{ user: { jwt: "actualtokenhash" } }` then the tokenPath should be `[ "user", "jwt" ]`.
243243
* By default
244244

245-
The authentication system, when enabled will attempt to fetch the authentication-token as soon as it is setup (trying to prefetch it to have it ready asap in case a search is made).
245+
The authentication system, when enabled will attempt to fetch the authentication-token as soon as it is setup (trying to pre-fetch it to have it ready asap in case a search is made).
246246

247247
The authentication system decodes the jwt-token when received and checks for when the token expires. It then sets up a timeout to fetch a new token in ample time before the current one expires. The overlap for this is defined in its triggers: `authentication: { triggers: { expiryOverlap: 60 } }`. The default is 60 seconds, which means that the client will try to get a new JWT 60 seconds before the old one expires.
248248

249249
## Documentation / Intellisense / Types
250250

251-
If you are using typescript, then the datatypes are available for your IDE to use. If not, then all types and definitions are available in the generated API-documentation in the search-client docs-folder (typically `./node_modules/search-client/docs/index.html`).
251+
If you are using typescript, then the data-types are available for your IDE to use. If not, then all types and definitions are available in the generated API-documentation in the search-client docs-folder (typically `./node_modules/search-client/docs/index.html`).

docs/classes/query.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ <h3><span class="tsd-flag ts-flagOptional">Optional</span> client<wbr>Id</h3>
152152
</aside>
153153
<div class="tsd-comment tsd-typography">
154154
<div class="lead">
155-
<p>Any string that you want to identify the client with. Can be used in the catgegories configuration and in the relevance tuning.</p>
155+
<p>Any string that you want to identify the client with. Can be used in the categories configuration and in the relevance tuning.</p>
156156
</div>
157157
</div>
158158
</section>
@@ -238,15 +238,15 @@ <h3><span class="tsd-flag ts-flagOptional">Optional</span> match<wbr>Order<wbr>B
238238
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-external">
239239
<a name="matchpage" class="tsd-anchor"></a>
240240
<h3><span class="tsd-flag ts-flagOptional">Optional</span> match<wbr>Page</h3>
241-
<div class="tsd-signature tsd-kind-icon">match<wbr>Page<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> =&nbsp;0</span></div>
241+
<div class="tsd-signature tsd-kind-icon">match<wbr>Page<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> =&nbsp;1</span></div>
242242
<aside class="tsd-sources">
243243
<ul>
244244
<li>Defined in <a href="https://github.com/IntelliSearch/search-client/blob/master/src/Common/Query.ts#L56">Common/Query.ts:56</a></li>
245245
</ul>
246246
</aside>
247247
<div class="tsd-comment tsd-typography">
248248
<div class="lead">
249-
<p>The actual page to fetch. The numbering is zero-based and expects a non-negative number.</p>
249+
<p>The actual page to fetch. Expects a number &gt;= 1.</p>
250250
</div>
251251
</div>
252252
</section>
@@ -261,7 +261,7 @@ <h3><span class="tsd-flag ts-flagOptional">Optional</span> match<wbr>Page<wbr>Si
261261
</aside>
262262
<div class="tsd-comment tsd-typography">
263263
<div class="lead">
264-
<p>The number of results per page to fetch. Expects a positive integer value.</p>
264+
<p>The number of results per page to fetch. Expects a number &gt;= 1.</p>
265265
</div>
266266
</div>
267267
</section>

docs/classes/querycategorizeconverterv2.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h1>Class QueryCategorizeConverterV2</h1>
6969
<section class="tsd-panel tsd-comment">
7070
<div class="tsd-comment tsd-typography">
7171
<div class="lead">
72-
<p>Class to handle creating categorize lookups for restservice version 2.</p>
72+
<p>Class to handle creating categorize lookups for rest-service version 2.</p>
7373
</div>
7474
</div>
7575
</section>
@@ -176,6 +176,9 @@ <h5>servicePath: <span class="tsd-signature-type">string</span></h5>
176176
</li>
177177
<li>
178178
<h5>query: <a href="query.html" class="tsd-signature-type">Query</a></h5>
179+
<div class="tsd-comment tsd-typography">
180+
<p>is the query that is to be converted into the url.</p>
181+
</div>
179182
</li>
180183
</ul>
181184
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>

docs/classes/queryfindconverterv2.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ <h5>servicePath: <span class="tsd-signature-type">string</span></h5>
172172
</li>
173173
<li>
174174
<h5>query: <a href="query.html" class="tsd-signature-type">Query</a></h5>
175+
<div class="tsd-comment tsd-typography">
176+
<p>is the query that is to be converted into the url.</p>
177+
</div>
175178
</li>
176179
</ul>
177180
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>

docs/classes/searchclient.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ <h1>Class SearchClient</h1>
8787
<ol>
8888
<li>Configure callbacks in your settings-object that you pass to the SearchClient.</li>
8989
<li>Configure triggers to define when to do server-lookups and not (if you need to deviate from the defaults)</li>
90-
<li>Set query-values realtime (queryText, filters, date-ranges, etc.)</li>
90+
<li>Set query-values real-time (queryText, filters, date-ranges, etc.)</li>
9191
<li>Receive autocomplete-suggestions, matches and categories in your callback handlers when the data is available.</li>
9292
</ol>
9393
<p>What happens is that any query-changes that arrive are checked in regards to trigger-settings. If they are to trigger
@@ -793,7 +793,7 @@ <h3>max<wbr>Suggestions</h3>
793793
</aside>
794794
<div class="tsd-comment tsd-typography">
795795
<div class="lead">
796-
<p>Gets the currently active max number of autopcomplete suggestions to get.</p>
796+
<p>Gets the currently active max number of autocomplete suggestions to get.</p>
797797
</div>
798798
</div>
799799
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
@@ -841,7 +841,7 @@ <h3>query</h3>
841841
<p><strong>Note:</strong> Changing the <code>query</code> property will likely lead to multiple trigger-checks and potential updates.
842842
This is because changing the whole value will lead to each of the query-objects&#39; properties to trigger individual
843843
events.</p>
844-
<p>To avoid mutliple updates, call <code>deferUpdates(true)</code> before and deferUpdates(false) afterwards. Then at max
844+
<p>To avoid multiple updates, call <code>deferUpdates(true)</code> before and deferUpdates(false) afterwards. Then at max
845845
only one update will be generated.</p>
846846
</div>
847847
<h4 class="tsd-returns-title">Returns <a href="query.html" class="tsd-signature-type">Query</a></h4>
@@ -859,7 +859,7 @@ <h4 class="tsd-returns-title">Returns <a href="query.html" class="tsd-signature-
859859
<p><strong>Note:</strong> Changing the <code>query</code> property will likely lead to multiple trigger-checks and potential updates.
860860
This is because changing the whole value will lead to each of the query-objects&#39; properties to trigger individual
861861
events.</p>
862-
<p>To avoid mutliple updates, call <code>deferUpdates(true)</code> before and deferUpdates(false) afterwards. Then at max
862+
<p>To avoid multiple updates, call <code>deferUpdates(true)</code> before and deferUpdates(false) afterwards. Then at max
863863
only one update will be generated.</p>
864864
</div>
865865
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -994,14 +994,14 @@ <h3>defer<wbr>Updates</h3>
994994
// When calling deferUpdates with (<span class="hljs-literal">false</span>) the above two update-events are now executed <span class="hljs-keyword">as</span> one instead (both value-changes are accounted <span class="hljs-keyword">for</span> though)
995995
searchClient.deferUpdates(<span class="hljs-literal">false</span>);
996996

997-
// Exmaple <span class="hljs-number">3</span>: Suppress updates (via deferUpdates):
997+
// Example <span class="hljs-number">3</span>: Suppress updates (via deferUpdates):
998998
searchClient.deferUpdates(<span class="hljs-literal">true</span>);
999999
// Change a prop that should trigger updates
10001000
searchClient.queryText = <span class="hljs-string">"some text"</span>;
10011001
// Call deferUpdates with (<span class="hljs-literal">false</span>, <span class="hljs-literal">true</span>), <span class="hljs-keyword">to</span> skip the pending <span class="hljs-keyword">update</span>.
10021002
searchClient.deferUpdates(<span class="hljs-literal">false</span>, <span class="hljs-literal">true</span>);
10031003

1004-
// Exmaple <span class="hljs-number">4</span>: Defer <span class="hljs-keyword">update</span> <span class="hljs-keyword">only</span> <span class="hljs-keyword">for</span> one service (Categorize <span class="hljs-keyword">in</span> this sample):
1004+
// Example <span class="hljs-number">4</span>: Defer <span class="hljs-keyword">update</span> <span class="hljs-keyword">only</span> <span class="hljs-keyword">for</span> one service (Categorize <span class="hljs-keyword">in</span> this sample):
10051005
searchClient.categorize.deferUpdates(<span class="hljs-literal">true</span>);
10061006
</code></pre></dd>
10071007
</dl>
@@ -1140,7 +1140,7 @@ <h3>find<wbr>And<wbr>Categorize</h3>
11401140
only one update per service is made (if any of their trigger-checks returned true).</p>
11411141
</div>
11421142
<p>When called it will unconditionally call the fetch() method of both Categorize and Find.</p>
1143-
<p>Note: The Autocomplete fetch() method is not called, as it is deemed very unexpected to awnt to list autocomplete
1143+
<p>Note: The Autocomplete fetch() method is not called, as it is deemed very unexpected to want to list autocomplete
11441144
suggestions when the Search-button is clicked.</p>
11451145
</div>
11461146
<h4 class="tsd-parameters-title">Parameters</h4>

docs/globals.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ <h3>Date<wbr>Specification</h3>
143143
</aside>
144144
<div class="tsd-comment tsd-typography">
145145
<div class="lead">
146-
<p>Represents a datespecification that can either be fixed or a delta from now.
147-
If the date is a moment DurationInputObject we calulcate the date in realtime when the fetch-call is executed.
146+
<p>Represents a date-specification that can either be fixed or a delta from now.
147+
If the date is a moment DurationInputObject we calculate the date in real-time when the fetch-call is executed.
148148
Note that the value must be an object with properties and values. I.e. { M: -1 } // One month ago
149149
See <a href="http://momentjs.com/docs/#/durations/">http://momentjs.com/docs/#/durations/</a>.
150150
Otherwise we assume that the value is a fixed value that the moment library can parse without any helping formatting

0 commit comments

Comments
 (0)