File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export const Entities = ({
6868 const newQuery = e . target . value ;
6969 const currentQuery = query ;
7070 setQuery ( newQuery ) ;
71- //When the user change the query text we reset the page number
71+ //When the user changes the query text we reset the page number
7272 const queryChanged = currentQuery !== newQuery ;
7373 if ( queryChanged ) {
7474 setPage ( 1 ) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public static String parse(String query) {
3030 throw new InvalidInputException ("Full text query parameter has @NotNull @NotBlank requirement" );
3131 }
3232 String parsedQuery = Stream .of (query .split ("[ @.,+*-]" ))
33- .filter (part -> !(part .isEmpty () || stopWords .contains (part .toLowerCase ())))
33+ .filter (part -> !(part .isEmpty () || part . length () < 3 || stopWords .contains (part .toLowerCase ()) ))
3434 .map (part -> "+" + part )
3535 .collect (Collectors .joining (" " ));
3636 return parsedQuery + "*" ;
Original file line number Diff line number Diff line change @@ -14,13 +14,16 @@ void parse() {
1414 assertEquals ("+test +john +doe +example +query*" , parsed );
1515
1616 String emailParsed = FullSearchQueryParser .parse ("brand+ms@play.com" );
17- assertEquals ("+brand +ms + play*" , emailParsed );
17+ assertEquals ("+brand +play*" , emailParsed );
1818
1919 String strippedWhiteSpace = FullSearchQueryParser .parse (" Leitndhireedisvea@example.com " );
2020 assertEquals ("+Leitndhireedisvea +example*" , strippedWhiteSpace );
2121
2222 String minusCharacter = FullSearchQueryParser .parse ("role-bug" );
2323 assertEquals ("+role +bug*" , minusCharacter );
24+
25+ String shortToken = FullSearchQueryParser .parse ("eduid.nl" );
26+ assertEquals ("+eduid*" , shortToken );
2427 }
2528
2629 @ Test
You can’t perform that action at this time.
0 commit comments