Project

General

Profile

« Previous | Next » 

Revision a0557101

Added by Andreas Kohlbecker over 5 years ago

fix #5868 avoiding unneccesary "complex phrase" queries, fixes bug introduced while solving #4223

View differences:

modules/cdm_dataportal/cdm_dataportal.search.php
550 550
  // ----------- further processing that must not be store in the session --------- //
551 551

  
552 552
  if($search_endpoint == CDM_WS_PORTAL_TAXON_SEARCH){
553
    // lucene based taxon search always as phrase search: enclose it in "
554
    if(!str_beginsWith($form_params['query'], '"')){
555
      $form_params['query'] = '"' . $form_params['query'];
556
    }
557
    if(!str_endsWith($form_params['query'], '"')){
558
      $form_params['query'] = $form_params['query'] . '"' ;
553
    // lucene based taxon search always as phrase search if the query string contains a whitespace --> enclose it in "
554
    if(preg_match("/\s+/", $form_params['query'])){
555
      if(!str_beginsWith($form_params['query'], '"')){
556
        $form_params['query'] = '"' . $form_params['query'];
557
      }
558
      if(!str_endsWith($form_params['query'], '"')){
559
        $form_params['query'] = $form_params['query'] . '"' ;
560
      }
559 561
    }
560 562
  }
561 563

  

Also available in: Unified diff