Set index name

@param string
@return Index
327343
public function setName($name)
    {
        $index_prefix = Config::get('larasearch.elasticsearch.index_prefix', '');
        if ($index_prefix && !Str::startsWith($name, $index_prefix)) $name = $index_prefix . $name;

        $this->name = $name;

        return $this;
    }
1261313
public function generateIndexName($indexName)
    {
        if (!$this->useIndexPrefix) {
            return $indexName;
        }

        $db = $this->getDbConnection();
        if (preg_match("/^{$db->tablePrefix}(.*?)$/", $indexName, $matches)) {
            $indexName = '{{%' . $matches[1] . '}}';
        } elseif (preg_match("/^(.*?){$db->tablePrefix}$/", $indexName, $matches)) {
            $indexName = '{{' . $matches[1] . '%}}';
        }
        return $indexName;
    }
1035738
protected function formatIndex($name)
    {
        if (\is_string($name)) {
            $exp = explode('.', $name);

            if (0 < \count($exp)) {
                $name = $exp[\count($exp) - 1];
            }
        }

        return $name;
    }
835303
public function setName($name)
	{
		// Check if we need to make this an array
		$endsWithBrackets = substr_compare($name, '[]', -2, 2) === 0;
		if ($this->isAutoArray() && ! $endsWithBrackets)
		{
			$name .= '[]';
		}

		$this->itSetName($name);

		// For any children, update the name
		foreach ($this->getContents() as $item)
		{
			$item->setName($this->getName());
		}

		return $this;
	}
302117
function indexifyName(name, scope) {
	const variables = scope.variableScope.set;

	let index = 1;
	while (variables.has(index === 1 ? name : name + index)) {
		index++;
	}

	return name + (index === 1 ? '' : index);
}
332002
public function setIndex($index)
    {
        $this->index = $index;

        $this->setIndexClean(
            str_replace('.', '', $index)
        );

        return $this;
    }
1127456
public function setName($name)
    {
        $this->name = is_string($name) ? ucfirst($name) : $this->name;
    }
13272
public function setName($name)
    {
        $this->validateName($name);

        if (!$this->name) {
            $this->name = $name;
        } elseif ($this->name !== $name) {
            $this->setAliases([$name]);
        }
        return $this;
    }
604895
public function setName($name)
    {
        if (!is_string($name) && !is_null($name)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->name = $name;

        return $this;
    }
1121958
public function setName($name)
    {
      if(!is_string($name) || strlen(trim($name)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid name, must be a non empty string');

      $this->name = $name;
    }
483965
public function setName($name)
    {
        if (is_scalar($name) || method_exists($name, '__toString')) {
            $this->name = (string) $name;
        } else {
            throw new InvalidArgumentException('The name must be a string.');
        }

        if ($this->name === '') {
            $this->name = 'Error';
        }

        return $this;
    }
394370
public function setName($name)
    {
        $attrName = $this->isMultiple()
            ? "{$name}[]"
            : $name;
        $this->setAttribute('name', $attrName);
        $this->name = $name;
        if ($label = $this->getLabel()) {
            $this->getLabel()->setAttribute('for', $this->generateId());
        }
        return $this;
    }
109664
public function setValue($string)
    {
        if (! is_array($string)) {
            $string = explode(",", $string);
        }

        $extras = ['noodp', 'noarchive', 'nosnippet',
            'noimageindex', 'noydir', 'nocache'];

        $indexes = ['index', 'noindex'];

        $follows = ['follow', 'nofollow'];

        foreach ($string as $key => $value) {
            $key = trim(strtolower($key));
            $value = trim(strtolower($value));

            if ($key == 'index' || in_array($value, $indexes)) {
                $this->index = $value;
            } elseif ($key == 'follow' || in_array($value, $follows)) {
                $this->follow = $value;
            } elseif (in_array($value, $extras)) {
                $this->extra[] = $value;
            }
        }
        return $this;
    }
850182
public function setIndex($index)
    {
        if ($this->index !== $index) {
            $this->index = $index;
            $this->addOrUpdate();
        }
    }
1233969
public function setName($name) {
    /** @var TokenNode $identifier */
    $identifier = $this->name->firstChild();
    $identifier->setText($name);
    return $this;
  }
1030203
public function setContentId(string $value) : SearchIndex
    {

        if ($this->data['content_id'] !== $value) {
            $this->data['content_id'] = $value;
            $this->setModified('content_id');
        }

        return $this;
    }
1338223
public function setName($name)
    {
        $name = preg_replace("/([^\w\s\d\-_~,;:\[\]\(\).]|[\.]{2,})/", "", $name);
        $name = basename($name);
        $this->name = $name;

        return $this;
    }