# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'solr'
end
end
end
# make sure autocommit is on
# make sure this doc isn't there to begin with
@connection.delete(123456)
# add it
@connection.add(:id => 123456, :text => 'Borges') # add :some_date => 'NOW/HOUR' to test richer data type handling
# now = DateTime.now
# look for it
# assert_equal now.year, hit['whatever_date'].year
# look for it via dismax
# delete it
@connection.delete(123456)
# make sure it's gone
end
# make sure autocommit is on
# make sure this doc isn't there to begin with
@connection.delete(123456)
# add it
# look for it
# delete it
@connection.delete(123456)
# make sure it's gone
end
end
flunk "Expected exception not raised"
# expected
assert true
end
end
end
end
end
end
# TODO: add test_ping back... something seems to have changed with the response, so adjustments are needed.
# non-critical - if Solr is broken we'll know from other tests!
# def test_ping
# assert_equal true, @connection.ping
# end
end
assert_equal false, conn.ping
end
end
end
doc = Solr::Document.new :id => 47, :ruby_text => 'puts "ouch!"'
request = Solr::Request::Standard.new :query => 'ouch'
end
request = Solr::Request::AddDocument.new(doc)
assert response.status_code == '0'
end
end
request = Solr::Request::AddDocument.new(doc)
end
# assert_equal false, response.ok?
# assert_match "ERROR:unknown field 'bogus'", response.status_message
end
ii = Solr::Request::IndexInfo.new
end
:highlighting => {
:max_snippets => 3,
:suffix => "<<"
}
)
end
end
# wipe the index clean
end
end