mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 09:21:43 +00:00
[Search] Changed default max results
Changed the default number of max results to be 100 results.
This commit is contained in:
parent
3fcf061679
commit
672fa74321
@ -22,14 +22,10 @@
|
|||||||
<span ng-controller="SearchbarController as controller">
|
<span ng-controller="SearchbarController as controller">
|
||||||
<!-- Search bar input -->
|
<!-- Search bar input -->
|
||||||
<div>
|
<div>
|
||||||
<span>
|
|
||||||
Search:
|
|
||||||
</span>
|
|
||||||
<input type="text"
|
<input type="text"
|
||||||
id="searchbarinput"
|
id="searchbarinput"
|
||||||
value=""
|
value=""
|
||||||
ng-keyup="controller.search('searchbarinput')"
|
ng-keyup="controller.search('searchbarinput')" />
|
||||||
style="width: 100%"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Results list -->
|
<!-- Results list -->
|
||||||
|
@ -44,7 +44,7 @@ define(
|
|||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function QueryService($http, objectService, ROOT) {
|
function QueryService($http, objectService, ROOT) {
|
||||||
var DEFAULT_MAX_RESULTS = 2048;
|
var DEFAULT_MAX_RESULTS = 100;
|
||||||
|
|
||||||
/////////////// The following is for non-Elastic Search /////////////////
|
/////////////// The following is for non-Elastic Search /////////////////
|
||||||
|
|
||||||
@ -162,14 +162,6 @@ define(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add wildcards to the font and end of each subterm
|
|
||||||
// Used by queryElasticsearch()
|
|
||||||
function addWildcards(searchTerm) {
|
|
||||||
return searchTerm.split(' ').map(function (s) {
|
|
||||||
return '*' + s + '*';
|
|
||||||
}).join(' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the fuzziness operator to the search term
|
// Add the fuzziness operator to the search term
|
||||||
// Used by queryElasticsearch()
|
// Used by queryElasticsearch()
|
||||||
function addFuzziness(searchTerm, editDistance) {
|
function addFuzziness(searchTerm, editDistance) {
|
||||||
@ -180,7 +172,6 @@ define(
|
|||||||
return searchTerm.split(' ').map(function (s) {
|
return searchTerm.split(' ').map(function (s) {
|
||||||
return s + '~' + editDistance;
|
return s + '~' + editDistance;
|
||||||
}).join(' ');
|
}).join(' ');
|
||||||
//searchTerm + '~' + editDistance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Currently specific to elasticsearch
|
// Currently specific to elasticsearch
|
||||||
@ -196,13 +187,12 @@ define(
|
|||||||
|
|
||||||
if (isDefaultInput(searchTerm)) {
|
if (isDefaultInput(searchTerm)) {
|
||||||
// Add fuzziness for completeness
|
// Add fuzziness for completeness
|
||||||
searchTerm = addFuzziness(searchTerm, 1);
|
searchTerm = addFuzziness(searchTerm, 2);
|
||||||
|
|
||||||
// Searching 'name' by default
|
// Searching 'name' by default
|
||||||
searchTerm = 'name:' + searchTerm;
|
searchTerm = 'name:' + searchTerm;
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log('processed search term ', searchTerm);
|
|
||||||
return searchTerm;
|
return searchTerm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user