[Groonga-commit] ranguba/rroonga at 463fe58 [master] Update weight vector documentation

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Mar 6 18:58:38 JST 2014


Kouhei Sutou	2014-03-06 18:58:38 +0900 (Thu, 06 Mar 2014)

  New Revision: 463fe582861e5541932e3838e3cbb496abc227fd
  https://github.com/ranguba/rroonga/commit/463fe582861e5541932e3838e3cbb496abc227fd

  Message:
    Update weight vector documentation

  Modified files:
    ext/groonga/rb-grn-variable-size-column.c

  Modified: ext/groonga/rb-grn-variable-size-column.c (+8 -6)
===================================================================
--- ext/groonga/rb-grn-variable-size-column.c    2014-03-06 18:49:10 +0900 (ed4e7d6)
+++ ext/groonga/rb-grn-variable-size-column.c    2014-03-06 18:58:38 +0900 (577de95)
@@ -225,7 +225,7 @@ rb_grn_variable_size_column_array_reference (VALUE self, VALUE rb_id)
  *                          :key_type => "ShortText") do |table|
  *        # This is weight vector.
  *        # ":with_weight => true" is important for matrix search result weight.
- *        table.short_text("Tags",
+ *        table.short_text("tags",
  *                         :type => :vector,
  *                         :with_weight => true)
  *      end
@@ -269,8 +269,8 @@ rb_grn_variable_size_column_array_reference (VALUE self, VALUE rb_id)
  *      p [record.key.key, record.score]
  *    end
  *    # Matches all records with weight.
- *    # => ["Groonga", 100]
- *    #    ["Rroonga", 10]
+ *    # => ["Groonga", 101]
+ *    #    ["Rroonga", 11]
  *
  *    # Increases score for "ruby" 10 times
  *    products.select(# The previous search result. Required.
@@ -286,8 +286,8 @@ rb_grn_variable_size_column_array_reference (VALUE self, VALUE rb_id)
  *      p [record.key.key, record.score]
  *    end
  *    # Weight is used for increasing score.
- *    # => ["Groonga", 100]  <- Not changed.
- *    #    ["Rroonga", 1010] <- 1000 (= 100 * 10) increased.
+ *    # => ["Groonga", 101]  <- Not changed.
+ *    #    ["Rroonga", 1021] <- 1021 (= 101 * 10 + 1) increased.
  *
  * @overload []=(id, elements)
  *   This description is for weight vector column.
@@ -307,7 +307,9 @@ rb_grn_variable_size_column_array_reference (VALUE self, VALUE rb_id)
  *     @[KEY]@ must be the same type of the key of the table that is
  *     specified as range on creating the weight vector.
  *
- *     @[WEIGHT]@ must be an positive integer.
+ *     @[WEIGHT]@ must be an positive integer. Note that search
+ *     becomes @weight + 1 �� . It means that You want to get 10 as
+ *     score, you should set 9 as weight.
  *
  * @overload []=(id, value)
  *   This description is for variable size columns except weight
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index