|
10 | 10 | import com.tencent.supersonic.chat.api.component.SemanticQuery; |
11 | 11 | import com.tencent.supersonic.chat.api.pojo.ChatContext; |
12 | 12 | import com.tencent.supersonic.chat.api.pojo.QueryContext; |
| 13 | +import com.tencent.supersonic.chat.api.pojo.SchemaElement; |
13 | 14 | import com.tencent.supersonic.chat.api.pojo.SemanticParseInfo; |
| 15 | +import com.tencent.supersonic.chat.api.pojo.SemanticSchema; |
14 | 16 | import com.tencent.supersonic.chat.api.pojo.request.DimensionValueReq; |
15 | 17 | import com.tencent.supersonic.chat.api.pojo.request.ExecuteQueryReq; |
16 | 18 | import com.tencent.supersonic.chat.api.pojo.request.QueryDataReq; |
@@ -580,8 +582,12 @@ private void validFilter(Set<QueryFilter> filters) { |
580 | 582 | @Override |
581 | 583 | public Object queryDimensionValue(DimensionValueReq dimensionValueReq, User user) throws Exception { |
582 | 584 | QueryResultWithSchemaResp queryResultWithSchemaResp = new QueryResultWithSchemaResp(); |
| 585 | + SemanticService semanticService = ContextUtils.getBean(SemanticService.class); |
| 586 | + SemanticSchema semanticSchema = semanticService.getSemanticSchema(); |
| 587 | + SchemaElement schemaElement = semanticSchema.getDimensions(dimensionValueReq.getElementID()); |
583 | 588 | Set<Long> detectModelIds = new HashSet<>(); |
584 | | - detectModelIds.add(dimensionValueReq.getModelId()); |
| 589 | + detectModelIds.add(schemaElement.getModel()); |
| 590 | + dimensionValueReq.setModelId(schemaElement.getModel()); |
585 | 591 | List<String> dimensionValues = getDimensionValues(dimensionValueReq, detectModelIds); |
586 | 592 | // if the search results is null,search dimensionValue from database |
587 | 593 | if (CollectionUtils.isEmpty(dimensionValues)) { |
|
0 commit comments