@@ -494,45 +494,6 @@ void ASSERT_FLOAT_EQ(float bar, u32 i, float a, float b) {
494
494
}
495
495
}
496
496
497
- void AnalyzeFunc (const String &analyzer_name, String &&text, TermList &output_terms) {
498
- UniquePtr<Analyzer> analyzer = AnalyzerPool::instance ().Get (analyzer_name);
499
- // (dynamic_cast<CommonLanguageAnalyzer*>(analyzer.get()))->SetExtractEngStem(false);
500
- if (analyzer.get () == nullptr ) {
501
- RecoverableError (Status::UnexpectedError (fmt::format (" Invalid analyzer: {}" , analyzer_name)));
502
- }
503
- Term input_term;
504
- input_term.text_ = std::move (text);
505
- TermList temp_output_terms;
506
- analyzer->Analyze (input_term, temp_output_terms);
507
- if (analyzer_name == AnalyzerPool::STANDARD) {
508
- // remove duplicates and only keep the root words for query
509
- const u32 INVALID_TERM_OFFSET = -1 ;
510
- Term last_term;
511
- last_term.word_offset_ = INVALID_TERM_OFFSET;
512
- for (const Term &term : temp_output_terms) {
513
- if (last_term.word_offset_ != INVALID_TERM_OFFSET) {
514
- assert (term.word_offset_ >= last_term.word_offset_ );
515
- }
516
- if (last_term.word_offset_ != term.word_offset_ ) {
517
- if (last_term.word_offset_ != INVALID_TERM_OFFSET) {
518
- output_terms.emplace_back (last_term);
519
- }
520
- last_term.text_ = term.text_ ;
521
- last_term.word_offset_ = term.word_offset_ ;
522
- last_term.stats_ = term.stats_ ;
523
- } else {
524
- if (term.text_ .size () < last_term.text_ .size ()) {
525
- last_term.text_ = term.text_ ;
526
- last_term.stats_ = term.stats_ ;
527
- }
528
- }
529
- }
530
- if (last_term.word_offset_ != INVALID_TERM_OFFSET) {
531
- output_terms.emplace_back (last_term);
532
- }
533
- }
534
- }
535
-
536
497
void ExecuteFTSearch (UniquePtr<EarlyTerminateIterator> &et_iter, FullTextScoreResultHeap &result_heap, u32 &blockmax_loop_cnt) {
537
498
if (et_iter) {
538
499
while (true ) {
@@ -585,12 +546,7 @@ bool PhysicalMatch::ExecuteInnerHomebrewed(QueryContext *query_context, Operator
585
546
if (!query_tree) {
586
547
RecoverableError (Status::ParseMatchExprFailed (match_expr_->fields_ , match_expr_->matching_text_ ));
587
548
}
588
- if (query_tree->type_ == QueryNodeType::PHRASE) {
589
- // TODO: make sure there is no problem with block max phrase and delete this code
590
- // LOG_INFO(fmt::format("Block max phrase not supported, use ordinary iterator, query: {}", match_expr_->matching_text_));
591
- use_block_max_iter = false ;
592
- use_ordinary_iter = true ;
593
- }
549
+
594
550
auto finish_parse_query_tree_time = std::chrono::high_resolution_clock::now ();
595
551
TimeDurationType parse_query_tree_duration = finish_parse_query_tree_time - finish_init_query_builder_time;
596
552
LOG_TRACE (fmt::format (" PhysicalMatch Part 0.2: Parse QueryNode tree time: {} ms" , parse_query_tree_duration.count ()));
@@ -868,8 +824,9 @@ bool PhysicalMatch::Execute(QueryContext *query_context, OperatorState *operator
868
824
SharedPtr<Vector<String>> PhysicalMatch::GetOutputNames () const {
869
825
SharedPtr<Vector<String>> result_names = MakeShared<Vector<String>>();
870
826
result_names->reserve (base_table_ref_->column_names_ ->size () + 2 );
871
- for (auto &name : *base_table_ref_->column_names_ )
827
+ for (auto &name : *base_table_ref_->column_names_ ) {
872
828
result_names->emplace_back (name);
829
+ }
873
830
result_names->emplace_back (COLUMN_NAME_SCORE);
874
831
result_names->emplace_back (COLUMN_NAME_ROW_ID);
875
832
return result_names;
0 commit comments