Skip to content

Commit

Permalink
adding promote functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuthay committed Dec 9, 2010
1 parent 8e4ddd2 commit 63e01cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions console
Expand Up @@ -21,6 +21,7 @@ COMMANDS = {
"status" => "shows index status",
"doc-var" => "[docid] [var index] [var value] sets var index as var value on docid",
"query-var" => "[var index] [var value] sets var index as var value for queries\n\t\t[var index] 'clear' clears var index for queries",
"promote" => "[docid] [query] promotes docid when searching for query",
"quit" => "exits this shell"
}

Expand Down Expand Up @@ -102,6 +103,14 @@ def command(line)
else
printf "no suggestions for %s :(\n", query
end
when "promote"
if args.length < 3
printf "usage: 'promote' %s\n", COMMANDS['promote']
else
docid = args[1]
query = args[2..args.length].join ' '
result = @index.promote(docid, query)
end
when "add"
if @index == nil
puts 'set an index first'
Expand Down

0 comments on commit 63e01cb

Please sign in to comment.