public function add($element)
    {
        if ($element instanceof TermQuery) {
            parent::add($element);
        } else {
            parent::add(
                (new TermQuery())
                    ->setValue($element)
            );
        }

        return $this;
    }
public function add($element)
    {
        if ($element instanceof TermQuery) {
            parent::add($element);
        } else {
            parent::add(
                (new TermQuery())
                    ->setValue($element)
            );
        }

        return $this;
    }
public function add ( $ element ) { if ( $ element instanceof TermQuery ) { parent :: add ( $ element ) ; } else { parent :: add ( ( new TermQuery ( ) ) -> setValue ( $ element ) ) ; } return $ this ; }
Add a term

@param string|TermQuery $element

@return TermCollectionQuery
Add a term