Exemple #1
0
    def index_all():
        indexes = []
        c = CoreEngine()

        fingerprints = Fingerprint.valid()

        c.deleteQuery('type_t:*')
        for fingerprint in fingerprints:
            print "-- Indexing fingerprint hash "+str(fingerprint.fingerprint_hash)
            indexes.append(fingerprint.indexFingerprint(batch_mode=True))

        print "-- Committing to solr"
        c.index_fingerprints(indexes)
    def index_all():
        indexes = []
        c = CoreEngine()

        fingerprints = Fingerprint.valid()

        c.deleteQuery('type_t:*')
        for fingerprint in fingerprints:
            print "-- Indexing fingerprint hash " + str(
                fingerprint.fingerprint_hash)
            indexes.append(fingerprint.indexFingerprint(batch_mode=True))

        print "-- Committing to solr"
        c.index_fingerprints(indexes)
    def __indexQueryLog(self):
        c = CoreEngine(core='suggestions')

        queries = QueryLog.objects.all()

        print "-- Indexing "+str(len(queries))+" simple queries"

        temp_array = []

        for query in queries:
            qdict = query.__dict__

            del qdict['_state']
            qdict['query'] = qdict['query'].strip().lower()
            temp_array.append(qdict)

            if len(temp_array) == 200:
                c.index_fingerprints(temp_array)
                temp_array = []

        if len(temp_array) > 0:
            c.index_fingerprints(temp_array)
Exemple #4
0
    def __indexQueryLog(self):
        c = CoreEngine(core='suggestions')

        queries = QueryLog.objects.all()

        print "-- Indexing " + str(len(queries)) + " simple queries"

        temp_array = []

        for query in queries:
            qdict = query.__dict__

            del qdict['_state']
            qdict['query'] = qdict['query'].strip().lower()
            temp_array.append(qdict)

            if len(temp_array) == 200:
                c.index_fingerprints(temp_array)
                temp_array = []

        if len(temp_array) > 0:
            c.index_fingerprints(temp_array)