-
Notifications
You must be signed in to change notification settings - Fork 2
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
Facet result for suggestion #835
base: dtq-dev
Are you sure you want to change the base?
Conversation
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.
Make it NO-case-sensitive
searchResult.getFacetResult(autocompleteCustom).forEach(facetResult -> { | ||
String displayedValue = facetResult.getDisplayedValue(); | ||
if (displayedValue.contains(searchValue)) { | ||
// Create a new VocabularyEntryRest object | ||
VocabularyEntryRest vocabularyEntryRest = new VocabularyEntryRest(); | ||
// All values from Item's specific index - it could contain values we are not looking for. | ||
// The must be filtered out. | ||
List<String> docValues = searchDocument.getSearchFieldValues(autocompleteCustom); | ||
|
||
// Filter values that contain searchValue | ||
List<String> filteredValues = docValues.stream() | ||
.filter(value -> value.contains(searchValue)) | ||
.collect(Collectors.toList()); | ||
|
||
// Add filtered values to the results. It contains only values that contain searchValue. | ||
filteredValues.forEach(value -> { | ||
vocabularyEntryRest.setDisplay(value); | ||
vocabularyEntryRest.setValue(value); | ||
results.add(vocabularyEntryRest); | ||
}); | ||
}); | ||
vocabularyEntryRest.setDisplay(displayedValue); | ||
vocabularyEntryRest.setValue(displayedValue); | ||
|
||
// Add the filtered value to the results | ||
results.add(vocabularyEntryRest); | ||
} |
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.
Do this also in the MetadataValueRestRepository
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.
We cannot use facet here because there is no metadata solar search index for it. But I modified search that for now we get all results, no only the first ten results.
@milanmajchrak |
@@ -231,11 +231,14 @@ public <E extends ReloadableEntity> E reloadEntity(final E entity) throws SQLExc | |||
log.info("reloadEntity() - Entity is null - return null"); | |||
return null; | |||
} else if (getSession().contains(entity)) { | |||
log.info("reloadEntity() - Entity is in the session - return entity with ID {}", entity.getID()); | |||
log.info("reloadEntity() - Entity is in the session - return entity with ID {}", | |||
entity.getID()); |
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.
This is because of the incorrect check style from dtg-dev branch
log.info("reloadEntity() - Entity is not in the session - return entity with ID {}", | ||
entity.getID()); | ||
return (E) getSession().get(HibernateProxyHelper.getClassWithoutInitializingProxy(entity), | ||
entity.getID()); |
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.
This is because of the incorrect check style from dtg-dev branch
Integer.MAX_VALUE : (int) totalResultsLong; | ||
// Perform the search again, this time retrieving the actual results based on the total count | ||
searchResult = createAndRunDiscoverResult(context, metadataField, searchValue, totalResults); | ||
for (IndexableObject object : searchResult.getIndexableObjects()) { |
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.
from 124 to 154 is original code, no changes
Problem description
Replace IndexObject by Facet.
Test link: http://localhost:8080/server/api/core/metadatavalues/search/byValue?schema=dc&element=title&searchValue=tes