1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed Unset in finalizeRebuildSet()

Discussion in 'Enhanced Search Resolved Bugs' started by digitalpoint, Jun 10, 2013.

  1. digitalpoint

    digitalpoint Well-Known Member

    Is the finalizeRebuildSet() method supposed to unset the entire $this->_bulkInserts property on every loop?

    PHP:
        public function finalizeRebuildSet()
        {
            foreach (
    $this->_bulkInserts AS $contentType => $results)
            {
                
    $result XenES_Api::indexBulk($this->_indexName$contentType$this->_bulkInserts[$contentType]);
                
    $this->_assertIndexSuccessful($result$contentType);
                unset(
    $this->_bulkInserts);
            }
            
    $this->_bulkInserts = array();
        }
    Maybe it's supposed to be unsetting the array it's working on?

    It ends up with a fatal error if you are bulk rebuilding multiple content types... This works:

    PHP:
        public function finalizeRebuildSet()
        {
            foreach (
    $this->_bulkInserts AS $contentType => $results)
            {
                
    $result XenES_Api::indexBulk($this->_indexName$contentType$this->_bulkInserts[$contentType]);
                
    $this->_assertIndexSuccessful($result$contentType);
                unset(
    $this->_bulkInserts[$contentType]);
            }
            
    $this->_bulkInserts = array();
        }
     
    Liam W and xf_phantom like this.
  2. Mike

    Mike XenForo Developer Staff Member

    Good catch. Fixed for the next ES release.
     
    digitalpoint and Liam W like this.
  3. Hornstar

    Hornstar Well-Known Member

    Question: What does ES stand for?
     
  4. MattW

    MattW Well-Known Member

    Enhanced Search
     
    Hornstar likes this.
  5. Andrej

    Andrej Well-Known Member

    Снимок экрана 2013-07-11 в 10.18.30.png (y)
     
  6. Hornstar

    Hornstar Well-Known Member

    I got here from my news feed and didn't realize I was in this section. I thought it must have been some kind of beta or RC kind of term lol. It seems so obvious now lol.
     

Share This Page