Assigns keywords from $keywordMap to the field with $fieldId.

$keywordMap has the format:
<code>
array(
'<keyword>' => <id>,
// ...
);
</code>

@param mixed $fieldId
@param mixed[] $keywordMap
191062
protected function assignKeywords($fieldId, $keywordMap)
    {
        $dbHandler = $this->getConnection();

        $keywordId = null;

        $insertQuery = $dbHandler->createInsertQuery();
        $insertQuery->insertInto(
            $dbHandler->quoteTable('ezkeyword_attribute_link')
        )->set(
            $dbHandler->quoteColumn('keyword_id'),
            $insertQuery->bindParam($keywordId)
        )->set(
            $dbHandler->quoteColumn('objectattribute_id'),
            $insertQuery->bindValue($fieldId)
        );

        $statement = $insertQuery->prepare();

        foreach ($keywordMap as $keyword => $keywordId) {
            $keywordId = $keywordMap[$keyword];
            $statement->execute();
        }
    }
1075698
public void setKeywords(final List<String> keywords) {
        StringBuilder builder = new StringBuilder();
        for (String keyword: keywords) {
            if (builder.length() > 0) {
                builder.append(',');
            }
            builder.append(keyword.trim());
        }
        this.keywords = Optional.of(builder.toString());
    }
224395
@Override
	public FieldList addField(Integer fieldID) {
		if (fieldID == null) {
			throw new IllegalArgumentException("Field ID must not be null.");
		}
		
		if (size() == 0) {
			return new FieldList(fieldID);
		} else {
			ArrayList<Integer> list = new ArrayList<Integer>(size() + 1);
			list.addAll(this.collection);
			list.add(fieldID);
			return new FieldList(Collections.unmodifiableList(list));
		}
	}
544788
private static function _autoUpdateFromFields(&$fields)
    {
        $addKeywords = [null, null];
        $removeKeywords = [null, null];

        if (isset($fields->add) && isset($fields->add->first_word)) {
            $addKeywords[0] = $fields->add->first_word;
        }

        if (isset($fields->add) && isset($fields->add->second_word)) {
            $addKeywords[1] = $fields->add->second_word;
        }

        if (isset($fields->remove) && isset($fields->remove->first_word)) {
            $removeKeywords[0] = $fields->remove->first_word;
        }

        if (isset($fields->remove) && isset($fields->remove->second_word)) {
            $removeKeywords[1] = $fields->remove->second_word;
        }

        return new Api\GroupAutoUpdate(
            $fields->to, $addKeywords, $removeKeywords
        );
    }
536631
public static function findField($fieldsList, $fieldId)
    {
        $fields = self::filterFieldList($fieldsList, $fieldId);

        if (1 != count($fields)) {
            return null;
        }

        return array_shift($fields);
    }
1350339
public static void set(String schemaPattern, Set<String> keywords) {
		SCHEMA_PATTERN = Pattern.compile(schemaPattern);

		KEYWORDS.clear();
		KEYWORDS.addAll(keywords);
	}
711405
public function parseKeywordToText($keywords, $alias = null)
    {
        foreach($keywords as $k => $v)
        {
            if(Text::isEmpty($v))
            {
                unset($keywords[$k]);
            }
        }
        $isLastStar = '*' === end($keywords);
        $result = BaseBuilder::DELIMITED_IDENTIFIERS . implode(BaseBuilder::DELIMITED_IDENTIFIERS . '.' . BaseBuilder::DELIMITED_IDENTIFIERS, $keywords) . BaseBuilder::DELIMITED_IDENTIFIERS;
        if($isLastStar)
        {
            $result = str_replace(BaseBuilder::DELIMITED_IDENTIFIERS . '*' . BaseBuilder::DELIMITED_IDENTIFIERS, '*', $result);
        }
        if(!Text::isEmpty($alias))
        {
            $result .= ' as ' . BaseBuilder::DELIMITED_IDENTIFIERS . $alias . BaseBuilder::DELIMITED_IDENTIFIERS;
        }
        return $result;
    }
105935
def AddClientKeywords(self, client_id, keywords, cursor=None):
    """"""
    cid = db_utils.ClientIDToInt(client_id)
    keywords = set(keywords)
    args = [(cid, mysql_utils.Hash(kw), kw) for kw in keywords]
    args = list(collection.Flatten(args))

    query = """
        INSERT INTO client_keywords (client_id, keyword_hash, keyword)
        VALUES {}
        ON DUPLICATE KEY UPDATE timestamp = NOW(6)
            """.format(", ".join(["(%s, %s, %s)"] * len(keywords)))
    try:
      cursor.execute(query, args)
    except MySQLdb.IntegrityError as e:
      raise db.UnknownClientError(client_id, cause=e)
670006
public function pushOneDoc($fields, $cmd) {
        $cmdName = Constant::get('DOC_KEY_CMD');
        $fieldName = Constant::get('DOC_KEY_FIELDS');
        $this->docs[] = array($cmdName => $cmd, $fieldName => $fields);
    }
2118
public void setKeyword(String keyword) {
    if(keyword != null) {
      keyword = keyword.trim();
    }
    this.keyword = keyword;
  }
1155208
public function filter($fieldMap = array())
    {
        if (empty($this->filter['filters'])) {
            return array();
        }

        $where = new Predicate();
        $where->addPredicate($this->parseFilters($this->filter, $fieldMap));

        return $where;
    }
894424
public function add_keyword($key, $word) {
        if (!is_array($this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key] = array();
        }
        if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key][] = $word;

            //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it
            if ($this->parse_cache_built) {
                $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
                $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
            }
        }
    }
465559
protected function assignPrimaryTitle(array & $mappers)
    {
        $fieldsWithHeader = array_filter($mappers, function ($mapper) {
            return $mapper->field->isHeader;
        });

        if (count($fieldsWithHeader) == 0) {
            $found = false;

            foreach ($mappers as $mapper) {
                if ($found) {
                    $mapper->field->isHeader = false;
                    continue;
                }
  
                if ($this->isPrimaryHeader($mapper->field) && (! array_key_exists('is-header', $mapper->meta) || $mapper->meta['is-header'])) {
                    $found = true;
                    $mapper->field->isHeader = true;
                }
            }
        }

        return $this;
    }
635995
protected function getAssignedKeywords($fieldId)
    {
        $dbHandler = $this->getConnection();

        $query = $dbHandler->createSelectQuery();
        $query->select('keyword')
            ->from($dbHandler->quoteTable('ezkeyword'))
            ->innerJoin(
                $dbHandler->quoteTable('ezkeyword_attribute_link'),
                $query->expr->eq(
                    $dbHandler->quoteColumn('id', 'ezkeyword'),
                    $dbHandler->quoteColumn('keyword_id', 'ezkeyword_attribute_link')
                )
            )
            ->where(
                $query->expr->eq(
                    $dbHandler->quoteColumn('objectattribute_id', 'ezkeyword_attribute_link'),
                    $fieldId
                )
            );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_COLUMN, 0);
    }
1062579
public function setKeyword($keyword, $action)
    {
        if (!is_callable($action)) {
            throw new InvalidArgumentException("Please add a callable action for your keyword $keyword", 30);
        }

        if (!$this->hasValidCustomKeywordsOption()) {
            $this->setOption('keywords', []);
        }

        if ($action instanceof ExtensionContainerInterface) {
            $this->addExtension($action->getExtension());
        }

        $this->setOption(['keywords', $keyword], $action);
    }
77263
public function setKeywords(array $keywords)
    {
        // Removes old keywords
        $oldKeywords = array_filter($this->keywords->toArray(), function (Keyword $keyword) use ($keywords) {
            return !in_array($keyword, $keywords);
        });
        array_walk($oldKeywords, function (Keyword $keyword) {
            $this->removeKeyword($keyword);
        });

        // Adds new ones
        array_walk($keywords, function (Keyword $keyword) {
            $this->addKeyword($keyword);
        });
    }
1343369
public function setField($name, $key, $value)
    {
        if (!array_key_exists($name, $this->fields)) {
            $this->fields[$name] = [];
        }
        $this->fields[$name][$key] = $value;
    }