mirror of
https://github.com/nasa/openmct.git
synced 2025-06-06 01:11:41 +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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +240,7 @@ define(
|
|||||||
* Searches through the filetree for domain objects using a search
|
* Searches through the filetree for domain objects using a search
|
||||||
* term. This is done through querying elasticsearch.
|
* term. This is done through querying elasticsearch.
|
||||||
* Notes:
|
* 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.
|
* as elsaticsearch determines them to be.
|
||||||
* * Folders are not included in the results.
|
* * Folders are not included in the results.
|
||||||
* * Wildcards are supported.
|
* * Wildcards are supported.
|
||||||
@ -266,7 +256,7 @@ define(
|
|||||||
*/
|
*/
|
||||||
function queryElasticsearch(inputID, maxResults) {
|
function queryElasticsearch(inputID, maxResults) {
|
||||||
var searchTerm;
|
var searchTerm;
|
||||||
|
|
||||||
// Check to see if the user provided a maximum
|
// Check to see if the user provided a maximum
|
||||||
// number of results to display
|
// number of results to display
|
||||||
if (!maxResults) {
|
if (!maxResults) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user