@@ -152,16 +152,26 @@ window.initSearch = function(rawSearchIndex) {
152
152
removeEmptyStringsFromArray ( split ) ;
153
153
154
154
function transformResults ( results ) {
155
+ var duplicates = { } ;
155
156
var out = [ ] ;
157
+
156
158
for ( var i = 0 , len = results . length ; i < len ; ++ i ) {
157
- if ( results [ i ] . id > - 1 ) {
158
- var obj = searchIndex [ results [ i ] . id ] ;
159
- obj . lev = results [ i ] . lev ;
159
+ var result = results [ i ] ;
160
+
161
+ if ( result . id > - 1 ) {
162
+ var obj = searchIndex [ result . id ] ;
163
+ obj . lev = result . lev ;
160
164
var res = buildHrefAndPath ( obj ) ;
161
165
obj . displayPath = pathSplitter ( res [ 0 ] ) ;
162
166
obj . fullPath = obj . displayPath + obj . name ;
163
167
// To be sure than it some items aren't considered as duplicate.
164
168
obj . fullPath += "|" + obj . ty ;
169
+
170
+ if ( duplicates [ obj . fullPath ] ) {
171
+ continue ;
172
+ }
173
+ duplicates [ obj . fullPath ] = true ;
174
+
165
175
obj . href = res [ 1 ] ;
166
176
out . push ( obj ) ;
167
177
if ( out . length >= MAX_RESULTS ) {
@@ -971,19 +981,11 @@ window.initSearch = function(rawSearchIndex) {
971
981
}
972
982
973
983
var output = document . createElement ( "div" ) ;
974
- var duplicates = { } ;
975
984
var length = 0 ;
976
985
if ( array . length > 0 ) {
977
986
output . className = "search-results " + extraClass ;
978
987
979
988
array . forEach ( function ( item ) {
980
- if ( item . is_alias !== true ) {
981
- if ( duplicates [ item . fullPath ] ) {
982
- return ;
983
- }
984
- duplicates [ item . fullPath ] = true ;
985
- }
986
-
987
989
var name = item . name ;
988
990
var type = itemTypes [ item . ty ] ;
989
991
0 commit comments