Ejemplo n.º 1
0
def index_documents(ids, **kw):
    log.debug("Indexing documents: %r", ids)
    from wiki import es_search
    from wiki.models import Document

    for d in Document.uncached.filter(id__in=ids):
        es_search.index_doc(es_search.extract_document(d), refresh=True)
Ejemplo n.º 2
0
    def test_translations_get_parent_tags(self):
        doc1 = document(title=u'Audio too loud')
        doc1.save()
        doc1.tags.add(u'desktop')
        doc1.tags.add(u'windows')

        doc2 = document(title=u'Audio too loud bork bork', parent=doc1)
        doc2.save()
        doc2.tags.add(u'badtag')

        # Verify the parent has the right tags.
        doc_dict = extract_document(doc1)
        eq_(doc_dict['tag'], [u'desktop', u'windows'])

        # Verify the translation has the parent's tags.
        doc_dict = extract_document(doc2)
        eq_(doc_dict['tag'], [u'desktop', u'windows'])
Ejemplo n.º 3
0
    def test_translations_get_parent_tags(self):
        doc1 = document(title=u'Audio too loud')
        doc1.save()
        doc1.tags.add(u'desktop')
        doc1.tags.add(u'windows')

        doc2 = document(title=u'Audio too loud bork bork',
                        parent=doc1)
        doc2.save()
        doc2.tags.add(u'badtag')

        # Verify the parent has the right tags.
        doc_dict = extract_document(doc1)
        eq_(doc_dict['tag'], [u'desktop', u'windows'])

        # Verify the translation has the parent's tags.
        doc_dict = extract_document(doc2)
        eq_(doc_dict['tag'], [u'desktop', u'windows'])
Ejemplo n.º 4
0
def index_documents(ids, **kw):
    log.debug('Indexing documents: %r', ids)
    from wiki import es_search
    from wiki.models import Document
    for d in Document.uncached.filter(id__in=ids):
        es_search.index_doc(es_search.extract_document(d), refresh=True)