mirror of
https://github.com/nasa/openmct.git
synced 2025-03-25 13:28:38 +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">
|
||||
<!-- Search bar input -->
|
||||
<div>
|
||||
<span>
|
||||
Search:
|
||||
</span>
|
||||
<input type="text"
|
||||
id="searchbarinput"
|
||||
value=""
|
||||
ng-keyup="controller.search('searchbarinput')"
|
||||
style="width: 100%"/>
|
||||
ng-keyup="controller.search('searchbarinput')" />
|
||||
</div>
|
||||
|
||||
<!-- Results list -->
|
||||
|
@ -44,7 +44,7 @@ define(
|
||||
* @constructor
|
||||
*/
|
||||
function QueryService($http, objectService, ROOT) {
|
||||
var DEFAULT_MAX_RESULTS = 2048;
|
||||
var DEFAULT_MAX_RESULTS = 100;
|
||||
|
||||
/////////////// The following is for non-Elastic Search /////////////////
|
||||
|
||||
@ -162,14 +162,6 @@ define(
|
||||
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
|
||||
// Used by queryElasticsearch()
|
||||
function addFuzziness(searchTerm, editDistance) {
|
||||
@ -180,7 +172,6 @@ define(
|
||||
return searchTerm.split(' ').map(function (s) {
|
||||
return s + '~' + editDistance;
|
||||
}).join(' ');
|
||||
//searchTerm + '~' + editDistance;
|
||||
}
|
||||
|
||||
// Currently specific to elasticsearch
|
||||
@ -196,13 +187,12 @@ define(
|
||||
|
||||
if (isDefaultInput(searchTerm)) {
|
||||
// Add fuzziness for completeness
|
||||
searchTerm = addFuzziness(searchTerm, 1);
|
||||
searchTerm = addFuzziness(searchTerm, 2);
|
||||
|
||||
// Searching 'name' by default
|
||||
searchTerm = 'name:' + searchTerm;
|
||||
}
|
||||
|
||||
//console.log('processed search term ', searchTerm);
|
||||
return searchTerm;
|
||||
}
|
||||
|
||||
@ -250,7 +240,7 @@ define(
|
||||
* Searches through the filetree for domain objects using a search
|
||||
* term. This is done through querying elasticsearch.
|
||||
* Notes:
|
||||
* * The order of the results is from highest to lowest score,
|
||||
* * The order of the results is from highest to lowest score,
|
||||
* as elsaticsearch determines them to be.
|
||||
* * Folders are not included in the results.
|
||||
* * Wildcards are supported.
|
||||
@ -266,7 +256,7 @@ define(
|
||||
*/
|
||||
function queryElasticsearch(inputID, maxResults) {
|
||||
var searchTerm;
|
||||
|
||||
|
||||
// Check to see if the user provided a maximum
|
||||
// number of results to display
|
||||
if (!maxResults) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user