Method: IndexTank::IndexClient#search

Defined in:
lib/indextank_client.rb

#search(query, options = {}) ⇒ Object

the options argument may contain an :index_code definition to override this instance’s default index_code it can also contain any of the following:

:start => an int with the number of results to skip
:len => an int with the number of results to return
:snippet => a comma separated list of field names for which a snippet
            should be returned. (requires an index that supports snippets)
:fetch => a comma separated list of field names for which its content
          should be returned. (requires an index that supports storage)
:function => an int with the index of the scoring function to be used
             for this query


179
180
181
182
183
184
185
186
187
188
# File 'lib/indextank_client.rb', line 179

def search(query, options={})
    options = { :start => 0, :len => 10 }.merge(options)
    options.merge!( :q => query )
    begin
        code, r = GET "/search", options
        return r
    rescue HttpCodeException
        raise
    end
end