Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1021913 // dm_gazelle_fullSearch - try to search everywhere

JavaX fragment (include)

1  
static L dm_gazelle_fullSearch(S query, O... _) {
2  
  Set<S> types = cast optPar types(_);
3  
  int maxResults = optPar maxResults(_, 1000);
4  
  L<S> prepared = scoredSearch_prepare(query);
5  
  new Map<O, Int> scores;
6  
  
7  
  if (emptyOrContains(types, 'rule))
8  
    scoredSearchInAllStringFields_impl(prepared, scores,
9  
      (L) dm_call(dm_gazelle_rulesModule(), 'concepts));
10  
      
11  
  if (emptyOrContains(types, 'line))
12  
    scoredSearchInAllStringFields_impl(prepared, scores,
13  
      (L) dm_call(dm_gazelle_linesCRUD(), 'concepts));
14  
      
15  
  ret takeFirst(maxResults, keysSortedByValuesDesc(scores));
16  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney

No comments. add comment

Snippet ID: #1021913
Snippet name: dm_gazelle_fullSearch - try to search everywhere
Eternal ID of this version: #1021913/12
Text MD5: 2132fc22e88ade5af529e077ab282514
Author: stefan
Category: javax / discord
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-04 21:40:42
Source code size: 603 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 285 / 339
Version history: 11 change(s)
Referenced in: [show references]