Using Match in a sqlite fts5 query but need more control over ranking?

I have a virtual table created using fts5:

import sqlite3
# create a db in memory
con = sqlite3.connect(':memory:')
con.execute('create virtual table operators using fts5(family, operator, label, summary, tokenize=porter)')

# some sample data
samples = {'insideTOP':
              {'label':'Inside',
               'family':'TOP',
               'summary':'The Inside TOP places Input1 inside Input2.'
              },
           'inTOP':
              {'label':'In',
               'family':'TOP',
               'summary':'The In TOP is used to create a TOP input.'
              },
           'fileinSOP':
              {'label':'File In',
               'family':'SOP',
               'summary':'The File In SOP allows you to read a file'
              }
          }

# fill db with those values
for operator in samples.keys():
    opDescr = samples[operator]
    con.executescript("insert into operators (family, operator, label, summary) values ('{0}','{1}','{2}','{3}');".format(opDescr['family'],operator,opDescr['label'],opDescr['summary']))

with following columns

+--------+-----------+------------+----------------------------------------------+
| family | operator  |   label    |            summary                           |
+--------+-----------+------------+----------------------------------------------+
| TOP    | insideTOP | Inside     | The Inside TOP places Input1 inside Input2.|
| TOP    | inTOP     | In         | The In TOP is used to create a TOP input.    |
| SOP    | fileinSOP | File In    | The File In SOP allows you to read a file    |
+--------+-----------+------------+----------------------------------------------+

an example query is:

# query the db
query = "select operator from operators where operators match 'operator:In*' or operators match 'label:In*' order by family, bm25(operators)"
result = con.execute(query)

for row in result:
    print(row)

And as a result I get

  • fileinSOP
  • insideTOP
  • inTOP

For this particular case though, I'd actually like the 'inTOP' to appear before the 'insideTOP' as the label is a perfect match.

What would be a good technique to be able to massage these results the way I'd like them?

Thank you very much

Markus