We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23050
    • 1,842 Posts
    Hi there, Hi Coroico,

    Finally, I updated to 1.8 ! Thank you for this update. smiley

    I get just one thing I don’t understand... After certain words, a
    is added. So the extract is displayed on many lines, whereas it should not.

    For example, when searching for "meuble en bois", I get

    Chalet en <br />
    bois <br />
    et meubles design


    Tried to empty &extractSeparator paramater with &extractSeparator=`` .. nothing, even tried &extractSeparator=`??` but ?? are not displayed

    Where can I fix this ?

    Note that I also removed the
    li 87 of searchHighlight plugin lol

    Thanks for your help ! smiley
      • 23050
      • 1,842 Posts
      Ah ah.. when putting &extractSeparator=`` in the good ajaxsearch call (I mean in the result page), it works better ! laugh

      Thanks !
        • 5811
        • 1,717 Posts
        I get just one thing I don’t understand... After certain words, a
        is added. So the extract is displayed on many lines, whereas it should not.
        Thanks Perrine for this relevant remark .. because it’is a huge issue tongue that I have never noticed (right under my nose !)

        To understand try "education" on this demo with AS 1.8.0 and do the same search (with "education") with this demo1.8.1.
        I prefer the second one wink.

        This issue comes from the fact that when two extracts overlap each over, they are merged but, in 1.8.0 they are also cut by a extractSeparator. Which is not the correct algorithm.
        This issue is now registred as AJAXSEARCH-5 and now closed.

        To correct this issue replace line 829 of classes/search.class.php:
              // build the final extract
              for($i=0;$i<$nbExtr;$i++) {
                $finalExtract .= $extracts[$i]['etcLeft'] . $mbSubstr($text,$extracts[$i]['left'],$extracts[$i]['right'] - $extracts[$i]['left']+1) . $extracts[$i]['etcRight'] . $this->cfg['extractSeparator'];    
              } 
        by
              // build the final extract
              for($i=0;$i<$nbExtr;$i++) {
                $separation = ($extracts[$i]['etcRight'] != '') ? $this->cfg['extractSeparator'] : ''; // to avoid breaking sentences
                $finalExtract .= $extracts[$i]['etcLeft'] . $mbSubstr($text,$extracts[$i]['left'],$extracts[$i]['right'] - $extracts[$i]['left']+1) . $extracts[$i]['etcRight'] . $separation;    
              }
        Thanks again Perrine for this feedback.
          • 23050
          • 1,842 Posts
          Ok, I’ll change my code ! You’re welcome wink

          Edit : Ok... code changed, works fine without &extractSeparator=`` smiley

          Thanks wink