Skip to content

Commit

Permalink
Updated lookup UUID to deal with map of query logics
Browse files Browse the repository at this point in the history
  • Loading branch information
jwomeara committed Feb 10, 2024
1 parent c58bf33 commit e614fa6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void setTypes(Map<String,UUIDType> types) {
Map<String,UUIDType> allowedTypes = new HashMap<>();
if (allowedUUIDQueryLogicName != null && types != null) {
for (Map.Entry<String,UUIDType> uuidType : types.entrySet()) {
if (uuidType.getValue().getQueryLogic().equalsIgnoreCase(allowedUUIDQueryLogicName)) {
if (allowedUUIDQueryLogicName.equalsIgnoreCase(uuidType.getValue().getQueryLogic("default"))) {
allowedTypes.put(uuidType.getKey(), uuidType.getValue());
}
}
Expand Down Expand Up @@ -100,7 +100,7 @@ public void setAllowedUUIDQueryLogicName(String allowedUUIDQueryLogicName) {
if (this.allowedUUIDQueryLogicName != null && types != null) {
List<String> entriesToRemove = new ArrayList<>();
for (Map.Entry<String,UUIDType> uuidEntry : types.entrySet()) {
if (!uuidEntry.getValue().getQueryLogic().equalsIgnoreCase(allowedUUIDQueryLogicName)) {
if (allowedUUIDQueryLogicName.equalsIgnoreCase(uuidEntry.getValue().getQueryLogic("default"))) {
entriesToRemove.add(uuidEntry.getKey());
}
}
Expand Down
15 changes: 10 additions & 5 deletions src/test/resources/config/application-QueryStarterDefaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,20 +431,25 @@ datawave:
uuidTypes: &defaultUuidTypes
'EVENT_ID':
fieldName: 'EVENT_ID'
queryLogic: 'LuceneUUIDEventQuery'
queryLogics:
'default': 'LuceneUUIDEventQuery'
allowedWildcardAfter: 28
'UUID':
fieldName: 'UUID'
queryLogic: 'LuceneUUIDEventQuery'
queryLogics:
'default': 'LuceneUUIDEventQuery'
'PARENT_UUID':
fieldName: 'PARENT_UUID'
queryLogic: 'LuceneUUIDEventQuery'
queryLogics:
'default': 'LuceneUUIDEventQuery'
'PAGE_ID':
fieldName: 'PAGE_ID'
queryLogic: 'LuceneUUIDEventQuery'
queryLogics:
'default': 'LuceneUUIDEventQuery'
'PAGE_TITLE':
fieldName: 'PAGE_TITLE'
queryLogic: 'LuceneUUIDEventQuery'
queryLogics:
'default': 'LuceneUUIDEventQuery'

lookup:
columnVisibility: ""
Expand Down

0 comments on commit e614fa6

Please sign in to comment.