Commit 2e82af5d by Truong Ba Dieu

Connect to solr

parent a1896d33
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
# https://github.com/capistrano/rvm
# https://github.com/capistrano/rbenv
# https://github.com/capistrano/chruby
# https://github.com/capistrano/bundler
# https://github.com/capistrano/rails
#
require 'capistrano/rails'
require 'capistrano/rvm'
# require 'capistrano/rbenv'
# require 'capistrano/chruby'
require 'capistrano/bundler'
# require 'capistrano/rails/assets'
# require 'capistrano/rails/migrations'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
...@@ -42,7 +42,8 @@ group :development, :test do ...@@ -42,7 +42,8 @@ group :development, :test do
gem 'spring' gem 'spring'
end end
gem 'kaminari', '0.16.3' # gem 'kaminari', '0.16.3'
gem 'will_paginate', '~> 3.0.6'
gem 'font-awesome-sass', '4.3.2.1' gem 'font-awesome-sass', '4.3.2.1'
# Bootstrap 3: https://github.com/twbs/bootstrap-sass # Bootstrap 3: https://github.com/twbs/bootstrap-sass
gem 'bootstrap-sass', '3.3.4.1' gem 'bootstrap-sass', '3.3.4.1'
...@@ -57,8 +58,13 @@ gem "breadcrumbs_on_rails" ...@@ -57,8 +58,13 @@ gem "breadcrumbs_on_rails"
gem 'momentjs-rails', '>= 2.8.1' gem 'momentjs-rails', '>= 2.8.1'
gem 'bootstrap3-datetimepicker-rails', '~> 4.7.14' gem 'bootstrap3-datetimepicker-rails', '~> 4.7.14'
gem 'draper', '~> 1.3' gem 'draper', '~> 1.3'
gem 'sunspot_rails' gem 'rsolr'
gem 'sunspot_solr'
gem 'capistrano', '~> 3.1.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails', '~> 1.1.1'
gem 'capistrano-rvm', github: "capistrano/rvm"
group :development, :test do group :development, :test do
# gem 'capybara' # Integration test tool to simulate a user on a website. # gem 'capybara' # Integration test tool to simulate a user on a website.
...@@ -77,4 +83,5 @@ group :development, :test do ...@@ -77,4 +83,5 @@ group :development, :test do
gem 'rspec-rails', '~> 3.0.1' gem 'rspec-rails', '~> 3.0.1'
gem 'rspec-support' gem 'rspec-support'
gem "pry" gem "pry"
gem "quiet_assets"
end end
\ No newline at end of file
GIT
remote: git://github.com/capistrano/rvm.git
revision: 9cfef39cf0022839dca6b5b330dfefeb5fc363e7
specs:
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
...@@ -53,6 +61,16 @@ GEM ...@@ -53,6 +61,16 @@ GEM
builder (3.2.2) builder (3.2.2)
byebug (5.0.0) byebug (5.0.0)
columnize (= 0.9.0) columnize (= 0.9.0)
capistrano (3.1.0)
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)
capistrano-bundler (1.1.4)
capistrano (~> 3.1)
sshkit (~> 1.2)
capistrano-rails (1.1.3)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
capybara (2.4.4) capybara (2.4.4)
mime-types (>= 1.16) mime-types (>= 1.16)
nokogiri (>= 1.3.3) nokogiri (>= 1.3.3)
...@@ -67,6 +85,7 @@ GEM ...@@ -67,6 +85,7 @@ GEM
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.9.1.1) coffee-script-source (1.9.1.1)
colorize (0.7.7)
columnize (0.9.0) columnize (0.9.0)
daemons (1.2.3) daemons (1.2.3)
database_cleaner (1.4.1) database_cleaner (1.4.1)
...@@ -121,9 +140,6 @@ GEM ...@@ -121,9 +140,6 @@ GEM
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
json (1.8.3) json (1.8.3)
kaminari (0.16.3)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
launchy (2.4.3) launchy (2.4.3)
addressable (~> 2.3) addressable (~> 2.3)
loofah (2.0.2) loofah (2.0.2)
...@@ -139,14 +155,18 @@ GEM ...@@ -139,14 +155,18 @@ GEM
multi_json (1.11.2) multi_json (1.11.2)
multi_xml (0.5.5) multi_xml (0.5.5)
mysql2 (0.3.18) mysql2 (0.3.18)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
nokogiri (1.6.6.2) nokogiri (1.6.6.2)
mini_portile (~> 0.6.0) mini_portile (~> 0.6.0)
orm_adapter (0.5.0) orm_adapter (0.5.0)
pr_geohash (1.0.0)
pry (0.10.1) pry (0.10.1)
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.4) rack (1.6.4)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
...@@ -224,14 +244,10 @@ GEM ...@@ -224,14 +244,10 @@ GEM
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0) sprockets (>= 2.8, < 4.0)
sunspot (2.2.0) sshkit (1.7.1)
pr_geohash (~> 1.0) colorize (>= 0.7.0)
rsolr (~> 1.0.7) net-scp (>= 1.1.2)
sunspot_rails (2.2.0) net-ssh (>= 2.8.0)
nokogiri
rails (>= 3)
sunspot (= 2.2.0)
sunspot_solr (2.2.0)
temple (0.7.6) temple (0.7.6)
thin (1.6.3) thin (1.6.3)
daemons (~> 1.0, >= 1.0.9) daemons (~> 1.0, >= 1.0.9)
...@@ -260,6 +276,7 @@ GEM ...@@ -260,6 +276,7 @@ GEM
binding_of_caller (>= 0.7.2) binding_of_caller (>= 0.7.2)
railties (>= 4.0) railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
will_paginate (3.0.7)
xpath (2.0.0) xpath (2.0.0)
nokogiri (~> 1.3) nokogiri (~> 1.3)
...@@ -271,6 +288,10 @@ DEPENDENCIES ...@@ -271,6 +288,10 @@ DEPENDENCIES
bootstrap3-datetimepicker-rails (~> 4.7.14) bootstrap3-datetimepicker-rails (~> 4.7.14)
breadcrumbs_on_rails breadcrumbs_on_rails
byebug byebug
capistrano (~> 3.1.0)
capistrano-bundler (~> 1.1.2)
capistrano-rails (~> 1.1.1)
capistrano-rvm!
capybara capybara
coffee-rails (~> 4.1.0) coffee-rails (~> 4.1.0)
database_cleaner database_cleaner
...@@ -284,11 +305,12 @@ DEPENDENCIES ...@@ -284,11 +305,12 @@ DEPENDENCIES
font-awesome-sass (= 4.3.2.1) font-awesome-sass (= 4.3.2.1)
jbuilder (~> 2.0) jbuilder (~> 2.0)
jquery-rails jquery-rails
kaminari (= 0.16.3)
momentjs-rails (>= 2.8.1) momentjs-rails (>= 2.8.1)
mysql2 mysql2
pry pry
quiet_assets
rails (= 4.2.1) rails (= 4.2.1)
rsolr
rspec rspec
rspec-core rspec-core
rspec-expectations rspec-expectations
...@@ -300,11 +322,10 @@ DEPENDENCIES ...@@ -300,11 +322,10 @@ DEPENDENCIES
shoulda-matchers shoulda-matchers
slim slim
spring spring
sunspot_rails
sunspot_solr
thin thin
turbolinks turbolinks
turnip turnip
uglifier (>= 1.3.0) uglifier (>= 1.3.0)
vacuum vacuum
web-console (~> 2.0) web-console (~> 2.0)
will_paginate (~> 3.0.6)
...@@ -5,7 +5,7 @@ class CategoriesController < ApplicationController ...@@ -5,7 +5,7 @@ class CategoriesController < ApplicationController
def show def show
@category = Category.find(params[:id]) @category = Category.find(params[:id])
@products = @category.products.page(params[:page]) @products = @category.products.paginate(:page => params[:page])
add_breadcrumb @category.name add_breadcrumb @category.name
end end
......
...@@ -6,12 +6,13 @@ class HomeController < ApplicationController ...@@ -6,12 +6,13 @@ class HomeController < ApplicationController
before_action :get_recommend before_action :get_recommend
def index def index
@products = Product.order(release_date: :desc).page(params[:page]) @products = Product.order(release_date: :desc).paginate(:page => params[:page])
end end
def search def search
add_breadcrumb "Search" add_breadcrumb "Search"
@products = Product.search_keyword(params) @solr_products = Product.search_keyword(params)
@products = Product.where("id IN (?)", @solr_products.map{|h| h["id"]})
end end
def cart def cart
......
...@@ -6,30 +6,33 @@ class Product < ActiveRecord::Base ...@@ -6,30 +6,33 @@ class Product < ActiveRecord::Base
# default 'public/images/product_default.jpg' # default 'public/images/product_default.jpg'
end end
paginates_per 5 self.per_page = ENV["default_perpage"]
validates :pid, :title, :price, :category_id, :image, :stock, :release_date, :public_date, presence: true validates :pid, :title, :price, :category_id, :stock, :release_date, :public_date, presence: true
validates :pid, uniqueness: true validates :pid, uniqueness: true
scope :recommend, -> { where(recommend: true) } scope :recommend, -> { where(recommend: true) }
searchable do after_save :update_solr
text :pid, :title, :author, :publisher, :studio, :currency, :image_uid before_destroy :remove_solr
boolean :recommend
double :price # searchable do
integer :category_id, :user_id, :stock # text :pid, :title, :author, :publisher, :studio
date :release_date # time :release_date
end # end
def self.search_keyword(params) def self.search_keyword(params)
where("title LIKE ?", "%#{params[:keyword]}%").order(release_date: :desc).page(params[:page]) # where("title LIKE ?", "%#{params[:keyword]}%").order(release_date: :desc).paginate(:page => params[:page])
# params[:page] ||= 1 # params[:page] ||= 1
# Product.search do # p = Product.search do
# fulltext params[:keyword] # fulltext params[:keyword]
# paginate :page => params[:page], :per_page => 5 # paginate :page => params[:page], :per_page => ENV["default_perpage"]
# order_by(:release_date, :desc) # order_by(:release_date, :desc)
# end # end
# p.results
SolrService.search(params)
end end
def can_buy?(quantity) def can_buy?(quantity)
...@@ -39,4 +42,13 @@ class Product < ActiveRecord::Base ...@@ -39,4 +42,13 @@ class Product < ActiveRecord::Base
def substract_stock(change) def substract_stock(change)
self.update_columns(stock: stock - change) self.update_columns(stock: stock - change)
end end
private
def update_solr
SolrService.add({id: id, title: title})
end
def remove_solr
SolrService.remove(id: id)
end
end end
require 'rubygems'
require 'rsolr'
class SolrService
def self.search(params={})
params[:page] ||= 1
params[:keyword] ||= ""
solr = RSolr.connect :url => ENV["solr_url"]
res = solr.paginate params[:page], ENV["default_perpage"], 'select', :params => {:q => "*#{params[:keyword]}*"}
res["response"]["docs"]
end
# add or update index to solr
# documents is {}, or [{},{}]
def self.add(documents)
solr = RSolr.connect :url => ENV["solr_url"]
solr.add documents
solr.commit
end
# delete index solr
# id is num or arr num
def self.remove(ids)
if ids.present?
solr = RSolr.connect :url => ENV["solr_url"]
solr.delete_by_id ids
solr.commit
end
end
end
...@@ -26,7 +26,10 @@ class VacuumAwsService ...@@ -26,7 +26,10 @@ class VacuumAwsService
def self.parse_item(item) def self.parse_item(item)
# only get product have pid, title, price # only get product have pid, title, price
if item.present? && item["ASIN"].present? && item["ItemAttributes"]["Title"].present? && item["ItemAttributes"]["ListPrice"].present? if item.present? && item["ASIN"].present? &&
item["ItemAttributes"]["Title"].present? &&
item["ItemAttributes"]["ListPrice"].present? &&
item["LargeImage"].present?
{ {
pid: item["ASIN"], pid: item["ASIN"],
title: item["ItemAttributes"]["Title"], title: item["ItemAttributes"]["Title"],
......
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
= render partial: "products/item", collection: @products, as: :product = render partial: "products/item", collection: @products, as: :product
.text-center .text-center
= paginate @products = will_paginate @products
\ No newline at end of file \ No newline at end of file
...@@ -4,4 +4,4 @@ h4= "Search with keyword '#{params[:keyword]}'" ...@@ -4,4 +4,4 @@ h4= "Search with keyword '#{params[:keyword]}'"
= render partial: "products/item", collection: @products, as: :product = render partial: "products/item", collection: @products, as: :product
.text-center .text-center
= paginate @products = will_paginate @solr_products
\ No newline at end of file \ No newline at end of file
...@@ -2,4 +2,8 @@ aws_access_key_id: "AKIAJ77C4CTZOP7TUVWQ" ...@@ -2,4 +2,8 @@ aws_access_key_id: "AKIAJ77C4CTZOP7TUVWQ"
aws_secret_access_key: "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" aws_secret_access_key: "cYJYb/MLGV0M6oi1+DjlliL1cfxmh78tKXnT6ZmX"
associate_tag: "zigexn6400-22" associate_tag: "zigexn6400-22"
solr_url: "http://tomcat:tomcat@localhost:8080/solr/venshop"
default_perpage: 5
default_send_mail: "no-reply@venshop.com" default_send_mail: "no-reply@venshop.com"
\ No newline at end of file
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'dieutb_venshop'
set :repo_url, 'git@gitlab.zigexn.vn:dieutb/VenShop.git'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/web/training/dieutb/'
# Default value for :scm is :git
# set :scm, :git
# Default value for :format is :pretty
# set :format, :pretty
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
# set :pty, true
# Default value for :linked_files is []
set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, 'deploy:restart'
after :finishing, 'deploy:cleanup'
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary
# server in each group is considered to be the first
# unless any hosts have the primary property set.
# Don't declare `role :all`, it's a meta role
set :stage, :production
role :app, %w{deploy@45.55.247.4}
role :web, %w{deploy@45.55.247.4}
role :db, %w{deploy@45.55.247.4}
# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server
# definition into the server list. The second argument
# something that quacks like a hash can be used to set
# extended properties on the server.
server '45.55.247.4', user: 'root', roles: %w{web app}
# you can set custom ssh options
# it's possible to pass any option but you need to keep in mind that net/ssh understand limited list of options
# you can see them in [net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start)
# set it globally
# set :ssh_options, {
# keys: %w(/home/rlisowski/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
# and/or per server
# server 'example.com',
# user: 'user_name',
# roles: %w{web app},
# ssh_options: {
# user: 'user_name', # overrides user setting above
# keys: %w(/home/user_name/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(publickey password)
# # password: 'please use keys'
# }
# setting per server overrides global ssh_options
...@@ -19,4 +19,4 @@ test: ...@@ -19,4 +19,4 @@ test:
# Do not keep production secrets in the repository, # Do not keep production secrets in the repository,
# instead read values from the environment. # instead read values from the environment.
production: production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> secret_key_base: a5cb22cc7065463cf7cb5b8e0deea024062b5349d723de32915b97f99dacbff92fd87a57787f897bfb86372ee0a5987a37454184d1dd1d854848d296e47f2381
production:
solr:
hostname: localhost
port: 8983
log_level: WARNING
path: /solr/production
# read_timeout: 2
# open_timeout: 0.5
development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/development
test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
path: /solr/test
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150716093626) do ActiveRecord::Schema.define(version: 20150717065015) do
create_table "categories", force: :cascade do |t| create_table "categories", force: :cascade do |t|
t.string "name", limit: 255 t.string "name", limit: 255
...@@ -28,7 +28,7 @@ ActiveRecord::Schema.define(version: 20150716093626) do ...@@ -28,7 +28,7 @@ ActiveRecord::Schema.define(version: 20150716093626) do
t.string "pid", limit: 255 t.string "pid", limit: 255
t.integer "item_count", limit: 4, default: 0 t.integer "item_count", limit: 4, default: 0
t.decimal "item_total", precision: 12, scale: 2, default: 0.0 t.decimal "item_total", precision: 12, scale: 2, default: 0.0
t.integer "state", limit: 4, default: 1 t.integer "state", limit: 4, default: 0
t.datetime "completed_at" t.datetime "completed_at"
t.integer "user_id", limit: 4 t.integer "user_id", limit: 4
t.datetime "created_at", null: false t.datetime "created_at", null: false
......
...@@ -4,8 +4,10 @@ namespace :crawler do ...@@ -4,8 +4,10 @@ namespace :crawler do
categories = %w(Books Music Electronics Software Kitchen) categories = %w(Books Music Electronics Software Kitchen)
categories.each do |search_cate| categories.each do |search_cate|
puts '111111111111111111111111111'
category = Category.find_or_create_by(name: search_cate) category = Category.find_or_create_by(name: search_cate)
(1..5).each do |page| (1..5).each do |page|
puts '2222222222222222222222222222'
next if category.products.count >= 20 # limit 20 products each category next if category.products.count >= 20 # limit 20 products each category
response = VacuumAwsService.item_search({ response = VacuumAwsService.item_search({
query: { query: {
...@@ -15,6 +17,7 @@ namespace :crawler do ...@@ -15,6 +17,7 @@ namespace :crawler do
'ResponseGroup' => 'Medium' 'ResponseGroup' => 'Medium'
} }
}) })
puts '3333333333333333333333333333333'
items = VacuumAwsService.parse_items(response) items = VacuumAwsService.parse_items(response)
items.each do |item| items.each do |item|
......
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
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
http://www.apache.org/licenses/LICENSE-2.0
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.
-->
<!-- The content of this page will be statically included into the top
of the admin page. Uncomment this as an example to see there the content
will show up.
<hr>
<i>This line will appear before the first table</i>
<tr>
<td colspan="2">
This row will be appended to the end of the first table
</td>
</tr>
<hr>
-->
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
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
http://www.apache.org/licenses/LICENSE-2.0
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.
-->
<!-- If this file is found in the config directory, it will only be
loaded once at startup. If it is found in Solr's data
directory, it will be re-loaded every commit.
-->
<elevate>
<query text="foo bar">
<doc id="1" />
<doc id="2" />
<doc id="3" />
</query>
<query text="ipod">
<doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
<doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
</query>
</elevate>
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
# Syntax:
# "source" => "target"
# "source".length() > 0 (source cannot be empty.)
# "target".length() >= 0 (target can be empty.)
# example:
# "À" => "A"
# "\u00C0" => "A"
# "\u00C0" => "\u0041"
# "ß" => "ss"
# "\t" => " "
# "\n" => ""
# À => A
"\u00C0" => "A"
# Á => A
"\u00C1" => "A"
# Â => A
"\u00C2" => "A"
# Ã => A
"\u00C3" => "A"
# Ä => A
"\u00C4" => "A"
# Å => A
"\u00C5" => "A"
# Æ => AE
"\u00C6" => "AE"
# Ç => C
"\u00C7" => "C"
# È => E
"\u00C8" => "E"
# É => E
"\u00C9" => "E"
# Ê => E
"\u00CA" => "E"
# Ë => E
"\u00CB" => "E"
# Ì => I
"\u00CC" => "I"
# Í => I
"\u00CD" => "I"
# Î => I
"\u00CE" => "I"
# Ï => I
"\u00CF" => "I"
# IJ => IJ
"\u0132" => "IJ"
# Ð => D
"\u00D0" => "D"
# Ñ => N
"\u00D1" => "N"
# Ò => O
"\u00D2" => "O"
# Ó => O
"\u00D3" => "O"
# Ô => O
"\u00D4" => "O"
# Õ => O
"\u00D5" => "O"
# Ö => O
"\u00D6" => "O"
# Ø => O
"\u00D8" => "O"
# Œ => OE
"\u0152" => "OE"
# Þ
"\u00DE" => "TH"
# Ù => U
"\u00D9" => "U"
# Ú => U
"\u00DA" => "U"
# Û => U
"\u00DB" => "U"
# Ü => U
"\u00DC" => "U"
# Ý => Y
"\u00DD" => "Y"
# Ÿ => Y
"\u0178" => "Y"
# à => a
"\u00E0" => "a"
# á => a
"\u00E1" => "a"
# â => a
"\u00E2" => "a"
# ã => a
"\u00E3" => "a"
# ä => a
"\u00E4" => "a"
# å => a
"\u00E5" => "a"
# æ => ae
"\u00E6" => "ae"
# ç => c
"\u00E7" => "c"
# è => e
"\u00E8" => "e"
# é => e
"\u00E9" => "e"
# ê => e
"\u00EA" => "e"
# ë => e
"\u00EB" => "e"
# ì => i
"\u00EC" => "i"
# í => i
"\u00ED" => "i"
# î => i
"\u00EE" => "i"
# ï => i
"\u00EF" => "i"
# ij => ij
"\u0133" => "ij"
# ð => d
"\u00F0" => "d"
# ñ => n
"\u00F1" => "n"
# ò => o
"\u00F2" => "o"
# ó => o
"\u00F3" => "o"
# ô => o
"\u00F4" => "o"
# õ => o
"\u00F5" => "o"
# ö => o
"\u00F6" => "o"
# ø => o
"\u00F8" => "o"
# œ => oe
"\u0153" => "oe"
# ß => ss
"\u00DF" => "ss"
# þ => th
"\u00FE" => "th"
# ù => u
"\u00F9" => "u"
# ú => u
"\u00FA" => "u"
# û => u
"\u00FB" => "u"
# ü => u
"\u00FC" => "u"
# ý => y
"\u00FD" => "y"
# ÿ => y
"\u00FF" => "y"
# ff => ff
"\uFB00" => "ff"
# fi => fi
"\uFB01" => "fi"
# fl => fl
"\uFB02" => "fl"
# ffi => ffi
"\uFB03" => "ffi"
# ffl => ffl
"\uFB04" => "ffl"
# ſt => ft
"\uFB05" => "ft"
# st => st
"\uFB06" => "st"
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#-----------------------------------------------------------------------
# Use a protected word file to protect against the stemmer reducing two
# unrelated words to the same base word.
# Some non-words that normally won't be encountered,
# just to test that they won't be stemmed.
dontstems
zwhacky
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
user=
solr_hostname=localhost
solr_port=8983
rsyncd_port=18983
data_dir=
webapp_name=solr
master_host=
master_data_dir=
master_status_dir=
pizza
history
\ No newline at end of file
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#-----------------------------------------------------------------------
# a couple of test stopwords to test that the words are really being
# configured from this file:
stopworda
stopwordb
#Standard english stop words taken from Lucene's StopAnalyzer
a
an
and
are
as
at
be
but
by
for
if
in
into
is
it
no
not
of
on
or
s
such
t
that
the
their
then
there
these
they
this
to
was
will
with
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#-----------------------------------------------------------------------
#some test synonym mappings unlikely to appear in real input text
aaa => aaaa
bbb => bbbb1 bbbb2
ccc => cccc1,cccc2
a\=>a => b\=>b
a\,a => b\,b
fooaaa,baraaa,bazaaa
# Some synonym groups specific to this example
GB,gib,gigabyte,gigabytes
MB,mib,megabyte,megabytes
Television, Televisions, TV, TVs
#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
#after us won't split it into two words.
# Synonym mappings can be used for spelling correction too
pixima => pixma
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="false">
<cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
<core name="default" instanceDir="." dataDir="default/data"/>
<core name="development" instanceDir="." dataDir="development/data"/>
<core name="test" instanceDir="." dataDir="test/data"/>
</cores>
</solr>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment