Project

General

Profile

Revision a0557101

IDa0557101d172b8f2acc143799186378be4c3a002
Parent a9dc4b35
Child bafcf277

Added by Andreas Kohlbecker about 2 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

Add picture from clipboard (Maximum size: 40 MB)