mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Whoosh 2.5 performance quickfix
In Whoosh 2.5, fields that can be sorted on need to specify sortable=True or else take a performance hit (a large one, in our case). These probably don't all need to be sortable, but hey.
This commit is contained in:
parent
9e3bfd7971
commit
4cd091241e
2 changed files with 6 additions and 6 deletions
|
@ -171,12 +171,12 @@ class PokedexLookup(object):
|
|||
"""Creates the index from scratch."""
|
||||
|
||||
schema = whoosh.fields.Schema(
|
||||
name=whoosh.fields.ID(stored=True, spelling=True),
|
||||
table=whoosh.fields.ID(stored=True),
|
||||
row_id=whoosh.fields.ID(stored=True),
|
||||
name=whoosh.fields.ID(sortable=True, stored=True, spelling=True),
|
||||
table=whoosh.fields.ID(sortable=True, stored=True),
|
||||
row_id=whoosh.fields.ID(sortable=True, stored=True),
|
||||
language=whoosh.fields.STORED,
|
||||
iso639=whoosh.fields.ID(stored=True),
|
||||
iso3166=whoosh.fields.ID(stored=True),
|
||||
iso639=whoosh.fields.ID(sortable=True, stored=True),
|
||||
iso3166=whoosh.fields.ID(sortable=True, stored=True),
|
||||
display_name=whoosh.fields.STORED, # non-lowercased name
|
||||
)
|
||||
|
||||
|
|
2
setup.py
2
setup.py
|
@ -9,7 +9,7 @@ setup(
|
|||
},
|
||||
install_requires=[
|
||||
'SQLAlchemy>=0.7.3',
|
||||
'whoosh>=2.2.2',
|
||||
'whoosh>=2.5',
|
||||
'markdown',
|
||||
'construct',
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue