Skip to content

Commit

Permalink
added methods to disable and enable indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
Crenshinibon committed Sep 19, 2013
1 parent 08c5ad2 commit f03a2a4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/spomet/indexes/custom.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
Spomet.CustomIndex = @CustomIndex
Spomet.options.indexes.push @CustomIndex

Meteor.methods
disableCustomIndex: () ->
i = Spomet.options.indexes.indexOf CustomIndex
if i isnt -1 then Spomet.options.indexes.splice i, 1
enableCustomIndex: () ->
Spomet.options.indexes.push CustomIndex

class @CustomIndex.Tokenizer
indexName: CustomIndex.name
index: CustomIndex
Expand Down
7 changes: 7 additions & 0 deletions packages/spomet/indexes/fullword.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
Spomet.FullWordIndex = @FullWordIndex
Spomet.options.indexes.push @FullWordIndex

Meteor.methods
disableFullWordIndex: () ->
i = Spomet.options.indexes.indexOf FullWordIndex
if i isnt -1 then Spomet.options.indexes.splice i, 1
enableFullWordIndex: () ->
Spomet.options.indexes.push FullWordIndex

class @FullWordIndex.Tokenizer
indexName: FullWordIndex.name
index: FullWordIndex
Expand Down
7 changes: 7 additions & 0 deletions packages/spomet/indexes/threegram.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
Spomet.ThreeGramIndex = @ThreeGramIndex
Spomet.options.indexes.push @ThreeGramIndex

Meteor.methods
disableThreeGramIndex: () ->
i = Spomet.options.indexes.indexOf ThreeGramIndex
if i isnt -1 then Spomet.options.indexes.splice i, 1
enableThreeGramIndex: () ->
Spomet.options.indexes.push ThreeGramIndex

class @ThreeGramIndex.Tokenizer
indexName: ThreeGramIndex.name
index: ThreeGramIndex
Expand Down
9 changes: 8 additions & 1 deletion packages/spomet/indexes/wordgroup.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@

Spomet.WordGroupIndex = @WordGroupIndex
Spomet.options.indexes.push @WordGroupIndex


Meteor.methods
disableWordGroupIndex: () ->
i = Spomet.options.indexes.indexOf WordGroupIndex
if i isnt -1 then Spomet.options.indexes.splice i, 1
enableWordGroupIndex: () ->
Spomet.options.indexes.push WordGroupIndex

class @WordGroupIndex.Tokenizer
indexName: WordGroupIndex.name
index: WordGroupIndex
Expand Down

0 comments on commit f03a2a4

Please sign in to comment.