Commit 9f5b3b7e authored by neelesh thakur's avatar neelesh thakur
Browse files

fix bug with sort on multi text field in a request

parent a8a9b20e
Pipeline #48417 failed with stages
in 78 minutes and 41 seconds
......@@ -85,10 +85,11 @@ public class FieldMappingTypeService implements IFieldMappingTypeService {
for (Map.Entry<String, Map<String, GetFieldMappingsResponse.FieldMappingMetadata>> indexMapping : mappings.entrySet()) {
if (indexMapping.getValue().isEmpty()) continue;
Map<String, GetFieldMappingsResponse.FieldMappingMetadata> typeMapping = indexMapping.getValue();
GetFieldMappingsResponse.FieldMappingMetadata fieldMappingMetaData = typeMapping.values().iterator().next();
if (fieldMappingMetaData == null) continue;
String field = fieldMappingMetaData.fullName();
fieldTypeMap.put(field.substring(0, field.lastIndexOf(".keyword")), field);
for (Map.Entry<String, GetFieldMappingsResponse.FieldMappingMetadata> fieldMappingMetadataEntry : typeMapping.entrySet()) {
if (fieldMappingMetadataEntry.getValue() == null) continue;
String field = fieldMappingMetadataEntry.getValue().fullName();
fieldTypeMap.put(field.substring(0, field.lastIndexOf(".keyword")), field);
}
}
this.typeMappingCache.put(cacheKey, fieldTypeMap);
......
......@@ -163,7 +163,7 @@ Feature: Search with different queries
Then I should get records in right order first record id: <first_record_id>, last record id: <last_record_id>
Examples:
| kind | query | sort | first_record_id | last_record_id |
| "tenant1:testquery<timestamp>:well:*" | None | {"field":["data.OriginalOperator"],"order":["ASC"]} | "test:well:1.0.0:1" | "test:well:2.0.0:3" |
| "tenant1:testquery<timestamp>:well:*" | None | {"field":["data.OriginalOperator","data.WellType"],"order":["ASC", "ASC"]} | "test:well:1.0.0:1" | "test:well:2.0.0:3" |
| "tenant1:testquery<timestamp>:well:*" | None | {"field":["id"],"order":["DESC"]} | "test:well:2.0.0:3" | "test:well:1.0.0:1" |
| "tenant1:testquery<timestamp>:well:*" | None | {"field":["namespace","data.Rank"],"order":["ASC","DESC"]} | "test:well:1.0.0:3" | "test:well:2.0.0:1" |
| "tenant1:testnestedquery<timestamp>:well:2.0.0" | None | {"field":["nested(data.VerticalMeasurements, VerticalMeasurement, min)"],"order":["ASC"]} | "test:well:1.0.0:2" | "test:well:1.0.0:1" |
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment