mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(improvement)(chat) Modify query type rules in QueryTypeParser (#570)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -117,7 +117,8 @@ public class SemanticSchema implements Serializable {
|
||||
|
||||
public List<SchemaElement> getTags(Set<Long> modelIds) {
|
||||
List<SchemaElement> tags = new ArrayList<>();
|
||||
modelSchemaList.stream().filter(schemaElement -> modelIds.contains(schemaElement.getModel()))
|
||||
modelSchemaList.stream().filter(schemaElement ->
|
||||
modelIds.contains(schemaElement.getModel().getModel()))
|
||||
.forEach(d -> tags.addAll(d.getTags()));
|
||||
return tags;
|
||||
}
|
||||
@@ -139,6 +140,11 @@ public class SemanticSchema implements Serializable {
|
||||
return entities;
|
||||
}
|
||||
|
||||
public List<SchemaElement> getEntities(Set<Long> modelIds) {
|
||||
List<SchemaElement> entities = getEntities();
|
||||
return getElementsByModelId(modelIds, entities);
|
||||
}
|
||||
|
||||
private List<SchemaElement> getElementsByModelId(Set<Long> modelIds, List<SchemaElement> elements) {
|
||||
return elements.stream()
|
||||
.filter(schemaElement -> modelIds.contains(schemaElement.getModel()))
|
||||
|
||||
Reference in New Issue
Block a user