( ctx context.Context, cond *plugin.SearchBasicCond)
| 64 | } |
| 65 | |
| 66 | func (s *SearchEngine) SearchContents( |
| 67 | ctx context.Context, cond *plugin.SearchBasicCond) ( |
| 68 | res []plugin.SearchResult, total int64, err error) { |
| 69 | if s.Operator == nil { |
| 70 | return nil, 0, fmt.Errorf("es client not init") |
| 71 | } |
| 72 | resp, err := s.Operator.QueryDoc(ctx, s.getIndexName(), |
| 73 | s.buildQuery(cond), s.buildSort(cond), s.buildCols(), cond.Page, cond.PageSize) |
| 74 | if err != nil { |
| 75 | return nil, 0, fmt.Errorf("es query error: %w", err) |
| 76 | } |
| 77 | if resp == nil { |
| 78 | return nil, 0, nil |
| 79 | } |
| 80 | return s.warpResult(resp) |
| 81 | } |
| 82 | |
| 83 | func (s *SearchEngine) SearchQuestions( |
| 84 | ctx context.Context, cond *plugin.SearchBasicCond) ( |
nothing calls this directly
no test coverage detected