lib/annoy.rb in annoy-rb-0.1.0 vs lib/annoy.rb in annoy-rb-0.2.0

- old
+ new

@@ -66,12 +66,13 @@ end # Build a forest of index trees. After building, no more items can be added. # # @param n_trees [Integer] The number of trees. More trees gives higher search precision. + # @param n_jobs [Integer] The number of threads used to build the trees. If -1 is given, uses all available CPU cores. # @return [Boolean] - def build(n_trees) - @index.build(n_trees) + def build(n_trees, n_jobs: -1) + @index.build(n_trees, n_jobs) end # Save the search index to disk. After saving, no more items can be added. # # @param filename [String] The filename of search index.