-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imlement scoring in elk for search elements #148
Conversation
…search # Conflicts: # src/main/java/org/gridsuite/directory/server/repository/DirectoryElementRepository.java # src/main/java/org/gridsuite/directory/server/services/DirectoryRepositoryService.java
…search # Conflicts: # src/main/java/org/gridsuite/directory/server/DirectoryService.java
I think the best mapping of a path is with field type : keyword |
Need complete tests for scoring with all cases |
@@ -58,6 +58,9 @@ public class DirectoryElementInfos { | |||
@Field(type = FieldType.Date, format = DateFormat.date_time) | |||
Instant lastModificationDate; | |||
|
|||
@Field(type = FieldType.Text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
.toList(); | ||
public List<DirectoryElementInfos> searchElements(@NonNull String userInput, String directoryUuid) { | ||
return directoryElementInfosService.searchElements(userInput, directoryUuid) | ||
.stream().filter(element -> isElementExists(element.getParentId())) // filter the Orphan elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SlimaneAmar in case of deletion of a directory , we can still have Orphans
// root
// / \
// dir1 (deleted but keeping its sub-elements) dir2
directoryElementRepository.deleteById(subDirUuid1);`
…into jamal-khey/store-path-in-elastic-search
code refactoring
Quality Gate passedIssues Measures |
public List<DirectoryElementInfos> searchElements(@NonNull String userInput, String currentDirectoryUuid) { | ||
|
||
// We dont want to show the directories | ||
Query directory = TermQuery.of(m -> m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Queries.termQuery(ELEMENT_TYPE, DIRECTORY)._toQuery() ?
to test this PR run :
to test and adjust boost go to : http://localhost:5601/app/dev_tools#/console
in the elastic search does not recommend using wildcard with a * in the beging, because This can increase the iterations needed to find matching terms and slow search performance.
to find how the score is computed use GET /directory-elements/_explain/doccumentId