Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
0025f56e
Commit
0025f56e
authored
Mar 16, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add command to build index
parent
9f9bb81c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
1 deletion
+31
-1
docs/install.rst
docs/install.rst
+2
-1
docs/management.rst
docs/management.rst
+7
-0
ftsearch/management/__init__.py
ftsearch/management/__init__.py
+0
-0
ftsearch/management/commands/__init__.py
ftsearch/management/commands/__init__.py
+0
-0
ftsearch/management/commands/rebuild_index.py
ftsearch/management/commands/rebuild_index.py
+22
-0
No files found.
docs/install.rst
View file @
0025f56e
...
...
@@ -85,4 +85,5 @@ On upgrade to version 0.6 you should run :program:`./manage.py syncdb` and
in installation section.
On upgrade to version 0.7 you should run :program:`./manage.py syncdb` to
setup new tables.
setup new tables and :program:`./manage.py rebuild_index` to build index for
fulltext search.
docs/management.rst
View file @
0025f56e
...
...
@@ -21,6 +21,13 @@ The ./manage.py is extended with following commands:
Reloads translations from disk (eg. in case you did some updates in Git
repository).
.. option:: rebuild_index
Rebuilds index for fulltext search. This might be lengthy operation if you
have huge set of translation units.
You can use ``--clean`` to remove all words from database prior updating.
.. option:: setupgroups
Configures default groups and (if called with ``--move``) assigns all users
...
...
ftsearch/management/__init__.py
0 → 100644
View file @
0025f56e
ftsearch/management/commands/__init__.py
0 → 100644
View file @
0025f56e
ftsearch/management/commands/rebuild_index.py
0 → 100644
View file @
0025f56e
from
django.core.management.base
import
BaseCommand
,
CommandError
from
trans.models
import
Unit
from
ftsearch.models
import
WordLocation
,
Word
from
optparse
import
make_option
class
Command
(
BaseCommand
):
help
=
'updates index for fulltext search'
option_list
=
BaseCommand
.
option_list
+
(
make_option
(
'--clean'
,
action
=
'store_true'
,
dest
=
'clean'
,
default
=
False
,
help
=
'removes also all words from database'
),
)
def
handle
(
self
,
*
args
,
**
options
):
if
options
[
'clean'
]:
Word
.
objects
.
all
().
delete
()
WordLocation
.
objects
.
all
().
delete
()
units
=
Unit
.
objects
.
all
()
for
unit
in
units
:
Unit
.
objects
.
add_to_index
(
unit
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment