[Groonga-commit] droonga/fluent-plugin-droonga at 3c97b75 [master] Extract SearchRequest#complex_output?

Back to archive index

Yoji Shidara null+****@clear*****
Thu Dec 19 17:46:50 JST 2013


Yoji Shidara	2013-12-19 17:46:50 +0900 (Thu, 19 Dec 2013)

  New Revision: 3c97b754bd627cd25aa764dd7f0e84460a863707
  https://github.com/droonga/fluent-plugin-droonga/commit/3c97b754bd627cd25aa764dd7f0e84460a863707

  Message:
    Extract SearchRequest#complex_output?

  Modified files:
    lib/droonga/searcher.rb

  Modified: lib/droonga/searcher.rb (+6 -2)
===================================================================
--- lib/droonga/searcher.rb    2013-12-19 17:41:20 +0900 (85e817f)
+++ lib/droonga/searcher.rb    2013-12-19 17:46:50 +0900 (f39137e)
@@ -125,6 +125,10 @@ module Droonga
       def need_output?
         @query.has_key?("output")
       end
+
+      def complex_output?
+        @query["output"]["format"] == "complex"
+      end
     end
 
     class SearchResult
@@ -357,7 +361,7 @@ module Droonga
 
         # XXX IMPLEMENT ME!!!
         attributes = nil
-        if****@reque*****["output"]["format"] == "complex"
+        if****@reque*****_output?
           # should convert columns to an object like:
           # {"_id" => {"type" => "UInt32", "vector" => false}}
           attributes = {}
@@ -380,7 +384,7 @@ module Droonga
         offset = params["offset"] || 0
         limit = params["limit"] || 10
         @result.records.open_cursor(:offset => offset, :limit => limit) do |cursor|
-          if params["format"] == "complex"
+          if****@reque*****_output?
             formatted_result["records"] = cursor.collect do |record|
               complex_record(target_attributes, record)
             end
-------------- next part --------------
HTML����������������������������...
다운로드 



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