Skip to content

Commit

Permalink
#4051 Fix search extraction for Elastic indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
stroomdev66 committed Mar 12, 2024
1 parent ec40ee4 commit 714af3a
Show file tree
Hide file tree
Showing 131 changed files with 1,137 additions and 1,069 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void acceptFieldValues(final List<FieldValue> fieldValues) {
// We have a match so pass the values on to the receiver.
final Val[] values = new Val[fieldIndex.size()];
for (final FieldValue fieldValue : fieldValues) {
final Integer index = fieldIndex.getPos(fieldValue.field().getName());
final Integer index = fieldIndex.getPos(fieldValue.field().getFldName());
if (index != null) {
values[index] = fieldValue.value();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AnalyticFields {
FIELDS.add(UUID_FIELD);
FIELDS.add(VALUE_FIELD);

FIELD_MAP = FIELDS.stream().collect(Collectors.toMap(QueryField::getName, Function.identity()));
FIELD_MAP = FIELDS.stream().collect(Collectors.toMap(QueryField::getFldName, Function.identity()));
}

public static List<QueryField> getFields() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public List<Meta> findMeta(final ExpressionOperator expression,
builder = builder.addOperator(statusExpression);

final FindMetaCriteria findMetaCriteria = new FindMetaCriteria(builder.build());
findMetaCriteria.setSort(MetaFields.ID.getName(), false, false);
findMetaCriteria.setSort(MetaFields.ID.getFldName(), false, false);
findMetaCriteria.obtainPageRequest().setLength(length);

return metaService.find(findMetaCriteria).getValues();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ public TableResultConsumer addRow(final Row row) {
final String value = sb.toString();

final Map<String, Object> attributeMap = new HashMap<>();
attributeMap.put(AnalyticFields.NAME_FIELD.getName(), analyticRuleDoc.getName());
attributeMap.put(AnalyticFields.UUID_FIELD.getName(), analyticRuleDoc.getUuid());
attributeMap.put(AnalyticFields.TIME_FIELD.getName(), time);
attributeMap.put(AnalyticFields.VALUE_FIELD.getName(), value);
attributeMap.put(AnalyticFields.NAME_FIELD.getFldName(), analyticRuleDoc.getName());
attributeMap.put(AnalyticFields.UUID_FIELD.getFldName(), analyticRuleDoc.getUuid());
attributeMap.put(AnalyticFields.TIME_FIELD.getFldName(), time);
attributeMap.put(AnalyticFields.VALUE_FIELD.getFldName(), value);

if (expressionMatcher.match(attributeMap, expression)) {
hitCount.increment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ public interface AnnotationFields {
COMMENT_FIELD,
HISTORY_FIELD);
Map<String, QueryField> FIELD_MAP = FIELDS.stream()
.collect(Collectors.toMap(QueryField::getName, Function.identity()));
.collect(Collectors.toMap(QueryField::getFldName, Function.identity()));
}
77 changes: 28 additions & 49 deletions stroom-app/src/main/resources/ui/noauth/swagger/stroom.json
Original file line number Diff line number Diff line change
Expand Up @@ -12885,13 +12885,6 @@
"ElasticIndexField" : {
"type" : "object",
"properties" : {
"analyzerType" : {
"type" : "string",
"enum" : [ "KEYWORD", "ALPHA", "NUMERIC", "ALPHA_NUMERIC", "WHITESPACE", "STOP", "STANDARD" ]
},
"caseSensitive" : {
"type" : "boolean"
},
"fieldName" : {
"type" : "string"
},
Expand All @@ -12902,24 +12895,18 @@
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
},
"indexed" : {
"type" : "boolean"
},
"name" : {
"type" : "string"
},
"nativeType" : {
"fldName" : {
"type" : "string"
},
"stored" : {
"type" : "boolean"
"fldType" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
},
"termPositions" : {
"indexed" : {
"type" : "boolean"
},
"type" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
"nativeType" : {
"type" : "string"
}
}
},
Expand Down Expand Up @@ -13732,17 +13719,13 @@
"docRefType" : {
"type" : "string"
},
"fieldName" : {
"type" : "string",
"writeOnly" : true
"fldName" : {
"type" : "string"
},
"fieldType" : {
"fldType" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
},
"name" : {
"type" : "string"
},
"queryable" : {
"type" : "boolean"
}
Expand Down Expand Up @@ -15318,21 +15301,21 @@
"type" : "string",
"enum" : [ "ID", "BOOLEAN_FIELD", "INTEGER_FIELD", "LONG_FIELD", "FLOAT_FIELD", "DOUBLE_FIELD", "DATE_FIELD", "FIELD", "NUMERIC_FIELD" ]
},
"fldName" : {
"type" : "string"
},
"fldType" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
},
"indexed" : {
"type" : "boolean"
},
"name" : {
"type" : "string"
},
"stored" : {
"type" : "boolean"
},
"termPositions" : {
"type" : "boolean"
},
"type" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
}
}
},
Expand Down Expand Up @@ -16732,7 +16715,10 @@
"docRefType" : {
"type" : "string"
},
"fieldType" : {
"fldName" : {
"type" : "string"
},
"fldType" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
},
Expand Down Expand Up @@ -18506,13 +18492,6 @@
"SolrIndexField" : {
"type" : "object",
"properties" : {
"analyzerType" : {
"type" : "string",
"enum" : [ "KEYWORD", "ALPHA", "NUMERIC", "ALPHA_NUMERIC", "WHITESPACE", "STOP", "STANDARD" ]
},
"caseSensitive" : {
"type" : "boolean"
},
"defaultValue" : {
"type" : "string"
},
Expand All @@ -18529,15 +18508,19 @@
"type" : "string",
"enum" : [ "ID", "BOOLEAN_FIELD", "INTEGER_FIELD", "LONG_FIELD", "FLOAT_FIELD", "DOUBLE_FIELD", "DATE_FIELD", "FIELD", "NUMERIC_FIELD" ]
},
"fldName" : {
"type" : "string"
},
"fldType" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
},
"indexed" : {
"type" : "boolean"
},
"multiValued" : {
"type" : "boolean"
},
"name" : {
"type" : "string"
},
"nativeType" : {
"type" : "string"
},
Expand Down Expand Up @@ -18574,10 +18557,6 @@
"termVectors" : {
"type" : "boolean"
},
"type" : {
"type" : "string",
"enum" : [ "ID", "BOOLEAN", "INTEGER", "LONG", "FLOAT", "DOUBLE", "DATE", "TEXT", "KEYWORD", "IPV4_ADDRESS", "DOC_REF" ]
},
"uninvertible" : {
"type" : "boolean"
}
Expand Down
99 changes: 35 additions & 64 deletions stroom-app/src/main/resources/ui/noauth/swagger/stroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9086,18 +9086,6 @@ components:
ElasticIndexField:
type: object
properties:
analyzerType:
type: string
enum:
- KEYWORD
- ALPHA
- NUMERIC
- ALPHA_NUMERIC
- WHITESPACE
- STOP
- STANDARD
caseSensitive:
type: boolean
fieldName:
type: string
fieldType:
Expand All @@ -9116,17 +9104,9 @@ components:
- KEYWORD
- IPV4_ADDRESS
- DOC_REF
indexed:
type: boolean
name:
fldName:
type: string
nativeType:
type: string
stored:
type: boolean
termPositions:
type: boolean
type:
fldType:
type: string
enum:
- ID
Expand All @@ -9140,6 +9120,10 @@ components:
- KEYWORD
- IPV4_ADDRESS
- DOC_REF
indexed:
type: boolean
nativeType:
type: string
ElasticIndexTestResponse:
type: object
properties:
Expand Down Expand Up @@ -9969,10 +9953,9 @@ components:
- "'=', '!=', '>', '>=', '<', '<=', 'between', 'in', 'in dictionary'"
docRefType:
type: string
fieldName:
fldName:
type: string
writeOnly: true
fieldType:
fldType:
type: string
enum:
- ID
Expand All @@ -9986,8 +9969,6 @@ components:
- KEYWORD
- IPV4_ADDRESS
- DOC_REF
name:
type: string
queryable:
type: boolean
Filter:
Expand Down Expand Up @@ -11494,15 +11475,9 @@ components:
- DATE_FIELD
- FIELD
- NUMERIC_FIELD
indexed:
type: boolean
name:
fldName:
type: string
stored:
type: boolean
termPositions:
type: boolean
type:
fldType:
type: string
enum:
- ID
Expand All @@ -11516,6 +11491,12 @@ components:
- KEYWORD
- IPV4_ADDRESS
- DOC_REF
indexed:
type: boolean
stored:
type: boolean
termPositions:
type: boolean
MapDefinition:
type: object
properties:
Expand Down Expand Up @@ -12760,7 +12741,9 @@ components:
- "'=', '!=', '>', '>=', '<', '<=', 'between', 'in', 'in dictionary'"
docRefType:
type: string
fieldType:
fldName:
type: string
fldType:
type: string
enum:
- ID
Expand Down Expand Up @@ -14280,18 +14263,6 @@ components:
SolrIndexField:
type: object
properties:
analyzerType:
type: string
enum:
- KEYWORD
- ALPHA
- NUMERIC
- ALPHA_NUMERIC
- WHITESPACE
- STOP
- STANDARD
caseSensitive:
type: boolean
defaultValue:
type: string
docValues:
Expand All @@ -14312,12 +14283,26 @@ components:
- DATE_FIELD
- FIELD
- NUMERIC_FIELD
fldName:
type: string
fldType:
type: string
enum:
- ID
- BOOLEAN
- INTEGER
- LONG
- FLOAT
- DOUBLE
- DATE
- TEXT
- KEYWORD
- IPV4_ADDRESS
- DOC_REF
indexed:
type: boolean
multiValued:
type: boolean
name:
type: string
nativeType:
type: string
omitNorms:
Expand All @@ -14342,20 +14327,6 @@ components:
type: boolean
termVectors:
type: boolean
type:
type: string
enum:
- ID
- BOOLEAN
- INTEGER
- LONG
- FLOAT
- DOUBLE
- DATE
- TEXT
- KEYWORD
- IPV4_ADDRESS
- DOC_REF
uninvertible:
type: boolean
SolrSynchState:
Expand Down
Loading

0 comments on commit 714af3a

Please sign in to comment.