笔记一下: 删除 git 仓库记录中的大文件

找出最大的5个文件

git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5 | awk '{print$1}')"

重写记录

git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch test.tar.gz' --tag-name-filter cat -- --all

强制推送

git push origin master -f

回收空间

rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now

定义 ElasticSearch Mapping

官方解析可以看这里:https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html

IK 相关内容可以看这里:https://github.com/medcl/elasticsearch-analysis-ik/

以下是优买吧的:

POST: /ymb

POST: /ymb/promotion/_mapping
{
    "promotion": {
        "_all": { "enabled": false },
        "properties": {
            "type": { "type": "byte" },
            "cid": { "type": "integer" },
            "root_cid": { "type": "integer" },
            "mall_type": { "type": "byte" },
            "mall_pid": { "type": "string", "index": "not_analyzed" },
            "title": {
                "type": "string",
                "analyzer": "ik_smart",
                "search_analyzer": "ik_smart",
                "term_vector": "no",
                "store": "false"
            },
            "feature": {
                "type": "string",
                "analyzer": "ik_smart",
                "search_analyzer": "ik_smart",
                "term_vector": "no",
                "store": "false"
            },
            "body": {
                "type": "string",
                "analyzer": "ik_smart",
                "search_analyzer": "ik_smart",
                "term_vector": "no",
                "store": "false"
            },
            "price": { "type": "integer" },
            "monthsales": { "type": "integer" },
            "transrate": { "type": "integer" },
            "commission": { "type": "byte" },
            "updated": { "type": "date" }
        }
    }
}

测试时用了 ik 作为中文分词库

← 上一页

下一页 →