当前位置: 首页>>代码示例>>Python>>正文


Python Document.all_ids方法代码示例

本文整理汇总了Python中aleph.model.Document.all_ids方法的典型用法代码示例。如果您正苦于以下问题:Python Document.all_ids方法的具体用法?Python Document.all_ids怎么用?Python Document.all_ids使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aleph.model.Document的用法示例。


在下文中一共展示了Document.all_ids方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: foreign_id_exists

# 需要导入模块: from aleph.model import Document [as 别名]
# 或者: from aleph.model.Document import all_ids [as 别名]
 def foreign_id_exists(self, source, foreign_id):
     q = Document.all_ids().filter(Document.source_id == source.id)
     q = q.filter(Document.foreign_id == foreign_id)
     exists = q.first() is not None
     if exists:
         log.info("Foreign ID exists (%s): %s", source, foreign_id)
     return exists
开发者ID:01-,项目名称:aleph,代码行数:9,代码来源:crawler.py

示例2: load_fixtures

# 需要导入模块: from aleph.model import Document [as 别名]
# 或者: from aleph.model.Document import all_ids [as 别名]
 def load_fixtures(self, file_name, process_documents=True):
     filepath = self.get_fixture_path(file_name)
     load_fixtures(db, loaders.load(filepath))
     db.session.commit()
     if process_documents:
         for doc_id, in Document.all_ids():
             analyze_document(doc_id)
         optimize_search()
开发者ID:stefanw,项目名称:aleph,代码行数:10,代码来源:util.py

示例3: load_fixtures

# 需要导入模块: from aleph.model import Document [as 别名]
# 或者: from aleph.model.Document import all_ids [as 别名]
 def load_fixtures(self, file_name, process_documents=True):
     filepath = os.path.abspath(os.path.join(FIXTURES, file_name))
     load_fixtures(db, loaders.load(filepath))
     db.session.commit()
     if process_documents:
         for doc_id, in Document.all_ids():
             analyze_document(doc_id)
         optimize_search()
开发者ID:01-,项目名称:aleph,代码行数:10,代码来源:util.py

示例4: index

# 需要导入模块: from aleph.model import Document [as 别名]
# 或者: from aleph.model.Document import all_ids [as 别名]
def index(foreign_id=None):
    """Index documents in the given source (or throughout)."""
    q = Document.all_ids()
    if foreign_id:
        source = Source.by_foreign_id(foreign_id)
        if source is None:
            raise ValueError("No such source: %r" % foreign_id)
        q = q.filter(Document.source_id == source.id)
    for doc_id, in q:
        index_document.delay(doc_id)
    if foreign_id is None:
        reindex_entities()
开发者ID:andkamau,项目名称:aleph,代码行数:14,代码来源:manage.py

示例5: index

# 需要导入模块: from aleph.model import Document [as 别名]
# 或者: from aleph.model.Document import all_ids [as 别名]
def index(foreign_id=None):
    """Index documents in the given collection (or throughout)."""
    q = Document.all_ids()
    if foreign_id:
        collection = Collection.by_foreign_id(foreign_id)
        if collection is None:
            raise ValueError("No such collection: %r" % foreign_id)
        clause = Collection.id == collection.id
        q = q.filter(Document.collections.any(clause))
    for doc_id, in q:
        index_document_id.delay(doc_id)
    if foreign_id is None:
        reindex_entities()
开发者ID:CodeForAfrica,项目名称:aleph,代码行数:15,代码来源:manage.py


注:本文中的aleph.model.Document.all_ids方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。