Projet

Général

Profil

0001-sql-add-display-id-and-formdef-name-to-full-text-ind.patch

Frédéric Péters, 17 août 2018 13:47

Télécharger (1,85 ko)

Voir les différences:

Subject: [PATCH] sql: add display id and formdef name to full-text index
 (#25643)

 wcs/sql.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
wcs/sql.py
1399 1399
                cur.execute(sql_statement, sql_dict)
1400 1400
                evo._sql_id = cur.fetchone()[0]
1401 1401

  
1402
        fts_strings = [str(self.id)]
1402
        fts_strings = [str(self.id), self.get_display_id()]
1403
        fts_strings.append(self._formdef.name)
1403 1404
        if self.tracking_code:
1404 1405
            fts_strings.append(self.tracking_code)
1405 1406
        for field in self._formdef.get_all_fields():
......
2141 2142
    return result
2142 2143

  
2143 2144

  
2144
SQL_LEVEL = 27
2145
SQL_LEVEL = 28
2145 2146

  
2146 2147
def migrate_global_views(conn, cur):
2147 2148
    cur.execute('''SELECT COUNT(*) FROM information_schema.tables
......
2243 2244
        # 21: (second part), store ascii_name of users
2244 2245
        # 23: (first part), use misc.simplify() over full text queries
2245 2246
        set_reindex('user', 'needed', conn=conn, cur=cur)
2246
    if sql_level < 23:
2247
    if sql_level < 28:
2247 2248
        # 17: store last_update_time in tables
2248 2249
        # 18: add user name to full-text search index
2249 2250
        # 21: (third part), add user ascii_names to full-text index
2250 2251
        # 23: (second part) use misc.simplify() over full text queries
2252
        # 28: add display id and formdef name to full-text index
2251 2253
        set_reindex('formdata', 'needed', conn=conn, cur=cur)
2252 2254
    if sql_level < 24:
2253 2255
        from wcs.formdef import FormDef
2254
-