Sha256: 3b7fae9d9619c186e2cc232fe709f8dfe877fffa3767675f373d1e44a3309f45
Contents?: true
Size: 950 Bytes
Versions: 2
Compression:
Stored size: 950 Bytes
Contents
module SimpleSolrClient ESCAPE_CHARS = '+-&|!(){}[]^"~*?:\\' ESCAPE_MAP = ESCAPE_CHARS.split(//).each_with_object({}) {|x,h| h[x] = "\\" + x} ESCAPE_PAT = Regexp.new('[' + Regexp.quote(ESCAPE_CHARS) + ']') # Escape those characters that need escaping to be valid lucene syntax. # Is *not* called internally, since how as I supposed to know if the parens/quotes are a # part of your string or there for legal lucene grouping? # def self.lucene_escape(str) esc = str.to_s.gsub(ESCAPE_PAT, ESCAPE_MAP) end # Where is the sample core configuration? SAMPLE_CORE_DIR = File.absolute_path File.join(File.dirname(__FILE__), '..', 'solr_sample_core') end require 'httpclient' require 'forwardable' require 'json' require "simple_solr_client/version" # Need to load core before client because of inter-dependencies resulting # in 'require' recursion require 'simple_solr_client/core' require 'simple_solr_client/client'
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
simple_solr_client-0.2.0 | lib/simple_solr_client.rb |
simple_solr_client-0.1.2 | lib/simple_solr_client.rb |