Beispiel #1
0
 def update_index(self, which_indexing):
     #setup new indexing
     if 'new' in which_indexing:
         indexing.update_index_properties(self)
     # setup old indexing
     if 'old' in which_indexing:
         prefix.update_prefix_properties(self)
 def update_index(self, which_indexing):
     #setup new indexing
     if 'new' in which_indexing:
         indexing.update_index_properties(self)
     # setup old indexing
     if 'old' in which_indexing:
         prefix.update_prefix_properties(self)
Beispiel #3
0
 def update_index(self, which_indexing):
     #setup new indexing
     if 'new' in which_indexing:
         indexing.update_index_properties(self)
         if config.get('enable_fulltext_search'):
             full_text_search.add_record_to_index(self)
     # setup old indexing
     if 'old' in which_indexing:
         prefix.update_prefix_properties(self)
Beispiel #4
0
 def update_index(self, which_indexing):
     #setup new indexing
     if 'new' in which_indexing:
         indexing.update_index_properties(self)
         if config.get('enable_fulltext_search'):
             full_text_search.add_record_to_index(self)
     # setup old indexing
     if 'old' in which_indexing:
         prefix.update_prefix_properties(self)
 def update_index(self, which_indexing):
     #setup new indexing
     if 'new' in which_indexing:
         indexing.update_index_properties(self)
     # setup old indexing
     if 'old' in which_indexing:
         prefix.update_prefix_properties(self)
     # index for full text search
     self.index()
Beispiel #6
0
    def test_search(self):
        persons = [TestPerson(first_name='Bryan', last_name='abc'),
                   TestPerson(first_name='Bryan', last_name='abcef'),
                   TestPerson(first_name='abc', last_name='Bryan'),
                   TestPerson(first_name='Bryan abc', last_name='efg'),
                   TestPerson(first_name='AAAA BBBB', last_name='CCC DDD')]
        for p in persons:
            indexing.update_index_properties(p)
            db.put(p)

        res = indexing.search(TestPerson.all(), TextQuery('Bryan abc'), 1)
        assert [(p.first_name, p.last_name) for p in res] == [('Bryan', 'abc')]

        res = indexing.search(TestPerson.all(), TextQuery('CC AAAA'), 100)
        assert [(p.first_name, p.last_name) for p in res] == \
            [('AAAA BBBB', 'CCC DDD')]
    def test_search(self):
        persons = [create_person(given_name='Bryan', family_name='abc'),
                   create_person(given_name='Bryan', family_name='abcef'),
                   create_person(given_name='abc', family_name='Bryan'),
                   create_person(given_name='Bryan abc', family_name='efg'),
                   create_person(given_name='AAAA BBBB', family_name='CCC DDD')]
        for p in persons:
            indexing.update_index_properties(p)
            db.put(p)

        res = indexing.search('test', TextQuery('Bryan abc'), 1)
        assert [(p.given_name, p.family_name) for p in res] == [('Bryan', 'abc')]

        res = indexing.search('test', TextQuery('CC AAAA'), 100)
        assert [(p.given_name, p.family_name) for p in res] == \
            [('AAAA BBBB', 'CCC DDD')]
Beispiel #8
0
    def test_search(self):
        persons = [
            TestPerson(first_name='Bryan', last_name='abc'),
            TestPerson(first_name='Bryan', last_name='abcef'),
            TestPerson(first_name='abc', last_name='Bryan'),
            TestPerson(first_name='Bryan abc', last_name='efg'),
            TestPerson(first_name='AAAA BBBB', last_name='CCC DDD')
        ]
        for p in persons:
            indexing.update_index_properties(p)
            db.put(p)

        res = indexing.search(TestPerson.all(), TextQuery('Bryan abc'), 1)
        assert [(p.first_name, p.last_name) for p in res] == [('Bryan', 'abc')]

        res = indexing.search(TestPerson.all(), TextQuery('CC AAAA'), 100)
        assert [(p.first_name, p.last_name) for p in res] == \
            [('AAAA BBBB', 'CCC DDD')]
    def test_search(self):
        persons = [
            create_person(given_name='Bryan', family_name='abc'),
            create_person(given_name='Bryan', family_name='abcef'),
            create_person(given_name='abc', family_name='Bryan'),
            create_person(given_name='Bryan abc', family_name='efg'),
            create_person(given_name='AAAA BBBB', family_name='CCC DDD')
        ]
        for p in persons:
            indexing.update_index_properties(p)
            db.put(p)

        res = indexing.search('test', TextQuery('Bryan abc'), 1)
        assert [(p.given_name, p.family_name)
                for p in res] == [('Bryan', 'abc')]

        res = indexing.search('test', TextQuery('CC AAAA'), 100)
        assert [(p.given_name, p.family_name) for p in res] == \
            [('AAAA BBBB', 'CCC DDD')]
Beispiel #10
0
 def add_persons(self, *persons):
     for p in persons:
         indexing.update_index_properties(p)
         db.put(p)
Beispiel #11
0
 def add_persons(self, *persons):
     for p in persons:
       indexing.update_index_properties(p)
       db.put(p)