).order_by("time_added").extra(where=["id is not null"]
                    ).distinct().reverse()),
        )


if __name__ == "__main__" :
    from django.conf import settings
    settings.SEARCH_STORAGE_PATH = settings.SEARCH_STORAGE_PATH  + "_test"
    settings.SEARCH_STORAGE_TYPE = "ram"

    import core, pylucene
    import models as models_tests
    models_tests.add()

    models_tests.cleanup_docs(models_tests.doc_without_index)
    models_tests.insert_docs(5, model=models_tests.doc_without_index)

    unittest.main(testRunner=models_tests.SearcherTestRunner(verbosity=2))



"""
Description
-----------


ChangeLog
---------


Usage
    from django.conf import settings
    settings.SEARCH_STORAGE_PATH = settings.SEARCH_STORAGE_PATH  + "_test"
    settings.SEARCH_STORAGE_TYPE = "fs"
    settings.DEBUG = False

    from django.db.models import Q

    import core
    import models as models_tests

    models_tests.add()

    models_tests.cleanup_index()
    models_tests.cleanup_docs()
    models_tests.insert_docs(3)

    unittest.main(testRunner=models_tests.SearcherTestRunner(verbosity=2))
    sys.exit()



"""
Description
-----------


ChangeLog
---------

if __name__ == "__main__":

    from django.conf import settings
    settings.SEARCH_STORAGE_PATH = settings.SEARCH_STORAGE_PATH + "_tests"
    settings.SEARCH_STORAGE_TYPE = "fs"
    settings.DEBUG = False

    import core, pylucene, document
    import models as models_tests

    core.register_indexes(models_tests)

    models_tests.cleanup_index()
    models_tests.cleanup_docs()
    models_tests.insert_docs(1)

    unittest.main(testRunner=models_tests.SearcherTestRunner(verbosity=2))
    sys.exit()
"""
Description
-----------


ChangeLog
---------


Usage
-----
            set([i.pk for i in o_n]),
        )


if __name__ == "__main__":
    from django.conf import settings
    settings.SEARCH_STORAGE_PATH = settings.SEARCH_STORAGE_PATH + "_test"
    settings.DEBUG = False

    import core, pylucene
    import models as models_tests

    models_tests.add()

    models_tests.cleanup_docs(models_tests.doc_without_index)
    models_tests.insert_docs(5, model=models_tests.doc_without_index)

    unittest.main(testRunner=models_tests.SearcherTestRunner(verbosity=2))
"""
Description
-----------


ChangeLog
---------


Usage
-----

Exemplo n.º 5
0
    import sys

    from django.conf import settings
    settings.SEARCH_STORAGE_PATH = settings.SEARCH_STORAGE_PATH  + "_test"
    settings.SEARCH_STORAGE_TYPE = "fs"
    settings.DEBUG = False

    from django.core.exceptions import ObjectDoesNotExist
    from django.contrib.webdesign.lorem_ipsum import words, paragraphs
    import core, pylucene, document
    import models as models_tests
    models_tests.add()

    models_tests.cleanup_index()
    models_tests.cleanup_docs()
    models_tests.insert_docs(10)

    unittest.main(testRunner=models_tests.SearcherTestRunner(verbosity=2))
    sys.exit()



"""
Description
-----------


ChangeLog
---------