public function index($index = null) {
		if (is_null($index))
			return $this->discard('query.index');
	
		if ($index instanceof Column) {
			//get referred attribute
			$map = $this->entityProfile->getPropertyMap();
			if (!in_array($index->getName(), $map))
				throw new \InvalidArgumentException(sprintf("Column '%s' is unknown for class '%s'", $index->getName(), $this->entityProfile->getReflectionClass()->getName()));
			$name = array_flip($map)[$index->getName()];
		}
		elseif ($index instanceof Attr)
			$name = $index->getName();
		elseif (is_string($index))
			$name = $index;
		else
			throw new \InvalidArgumentException("Index must be specified through an Attr instance or a valid property name");
			
		//get custom type (if any)
		$type = ($index instanceof Field) ? $index->getType() : null;	
		if (isset($type))
			return $this->merge(['query.index' => $name. ':' . $type]);
		return $this->merge(['query.index' => $name]);
	}