예제 #1
0
 def handle(self, *commands, **options):
     if not commands:
         print self.help
     else:
         s = SolrIndex()
         for command in commands:
             if command == 'optimize':
                 s.optimize()
             elif command == 'index':
                 s.index(verbose=True)
             elif command == 'reindex':
                 s.index(verbose=True, all=True)
                 s.clear_missing(verbose=True)
             elif command == 'clean':
                 s.clear_missing(verbose=True)
             elif command == 'rebuild':
                 s.clear()
                 s.index(verbose=True, all=True)
             elif command == 'clear':
                 s.clear()
             else:
                 print "Invalid command %s" % command
예제 #2
0
파일: solr.py 프로젝트: GetHubMax/rooibos
 def handle(self, *commands, **options):
     if not commands:
         print self.help
     else:
         s = SolrIndex()
         for command in commands:
             if command == 'optimize':
                 s.optimize()
             elif command == 'index':
                 s.index(verbose=True)
             elif command == 'reindex':
                 s.index(verbose=True, all=True)
                 s.clear_missing(verbose=True)
             elif command == 'clean':
                 s.clear_missing(verbose=True)
             elif command == 'rebuild':
                 s.clear()
                 s.index(verbose=True, all=True)
             elif command == 'clear':
                 s.clear()
             else:
                 print "Invalid command %s" % command
예제 #3
0
    def handle(self, *args, **kwargs):
        if not args:
            print self.help
        else:
            collections = map(int, kwargs.get('collections') or list())

            s = SolrIndex()
            for command in args:
                if command == 'optimize':
                    s.optimize()
                elif command == 'index':
                    s.index(verbose=True)
                elif command == 'reindex':
                    s.index(verbose=True, all=True, collections=collections)
                    s.clear_missing(verbose=True)
                elif command == 'clean':
                    s.clear_missing(verbose=True)
                elif command == 'rebuild':
                    s.clear()
                    s.index(verbose=True, all=True, collections=collections)
                elif command == 'clear':
                    s.clear()
                else:
                    print "Invalid command %s" % command
예제 #4
0
파일: solr.py 프로젝트: knabar/fynbos
    def handle(self, *args, **kwargs):
        if not args:
            print self.help
        else:
            collections = map(int, kwargs.get('collections') or list())

            s = SolrIndex()
            for command in args:
                if command == 'optimize':
                    s.optimize()
                elif command == 'index':
                    s.index(verbose=True)
                elif command == 'reindex':
                    s.index(verbose=True, all=True, collections=collections)
                    s.clear_missing(verbose=True)
                elif command == 'clean':
                    s.clear_missing(verbose=True)
                elif command == 'rebuild':
                    s.clear()
                    s.index(verbose=True, all=True, collections=collections)
                elif command == 'clear':
                    s.clear()
                else:
                    print "Invalid command %s" % command