public function clearObsoleteClasses($classes)
    {
        if (empty($classes)) {
            return false;
        }

        // Delete all records which do not match the necessary classname rules
        $conditions = array();
        foreach ($classes as $class => $options) {
            if ($options['include_children']) {
                $conditions[] = "ClassHierarchy:{$class}";
            } else {
                $conditions[] = "ClassName:{$class}";
            }
        }

        // Delete records which don't match any of these conditions in this index
        $deleteQuery = "-(" . implode(' ', $conditions) . ")";
        $this
            ->getService()
            ->deleteByQuery($deleteQuery);
        return true;
    }
public function clearObsoleteClasses($classes)
    {
        if (empty($classes)) {
            return false;
        }

        // Delete all records which do not match the necessary classname rules
        $conditions = array();
        foreach ($classes as $class => $options) {
            if ($options['include_children']) {
                $conditions[] = "ClassHierarchy:{$class}";
            } else {
                $conditions[] = "ClassName:{$class}";
            }
        }

        // Delete records which don't match any of these conditions in this index
        $deleteQuery = "-(" . implode(' ', $conditions) . ")";
        $this
            ->getService()
            ->deleteByQuery($deleteQuery);
        return true;
    }
public function clearObsoleteClasses ( $ classes ) { if ( empty ( $ classes ) ) { return false ; } // Delete all records which do not match the necessary classname rules $ conditions = array ( ) ; foreach ( $ classes as $ class => $ options ) { if ( $ options [ 'include_children' ] ) { $ conditions [ ] = "ClassHierarchy:{$class}" ; } else { $ conditions [ ] = "ClassName:{$class}" ; } } // Delete records which don't match any of these conditions in this index $ deleteQuery = "-(" . implode ( ' ' , $ conditions ) . ")" ; $ this -> getService ( ) -> deleteByQuery ( $ deleteQuery ) ; return true ; }
Clear all records which do not match the given classname whitelist.

Can also be used to trim an index when reducing to a narrower set of classes.

Ignores current state / variant.

@param array $classes List of non-obsolete classes in the same format as SolrIndex::getClasses()
@return bool Flag if successful
@throws \Apache_Solr_HttpTransportException
Clear all records which do not match the given classname whitelist .