Commit 7f6a553a by Vy Quoc Vu

better

parent a7655c6e
...@@ -5,6 +5,8 @@ gem 'bootstrap-sass', '3.2.0.0' ...@@ -5,6 +5,8 @@ gem 'bootstrap-sass', '3.2.0.0'
gem 'will_paginate-bootstrap' gem 'will_paginate-bootstrap'
gem 'bootstrap-will_paginate', '0.0.10' gem 'bootstrap-will_paginate', '0.0.10'
gem 'faker', '1.4.2' gem 'faker', '1.4.2'
gem 'sunspot_rails'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3' gem 'rails', '4.2.3'
...@@ -46,6 +48,8 @@ group :development, :test do ...@@ -46,6 +48,8 @@ group :development, :test do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring' gem 'spring'
gem 'sunspot_solr'
end end
......
...@@ -127,6 +127,7 @@ GEM ...@@ -127,6 +127,7 @@ GEM
nenv (~> 0.1) nenv (~> 0.1)
shellany (~> 0.0) shellany (~> 0.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)
...@@ -171,6 +172,8 @@ GEM ...@@ -171,6 +172,8 @@ GEM
json (~> 1.4) json (~> 1.4)
responders (2.1.0) responders (2.1.0)
railties (>= 4.2.0, < 5) railties (>= 4.2.0, < 5)
rsolr (1.0.12)
builder (>= 2.1.2)
ruby-progressbar (1.7.5) ruby-progressbar (1.7.5)
sass (3.4.16) sass (3.4.16)
sass-rails (5.0.3) sass-rails (5.0.3)
...@@ -191,6 +194,14 @@ GEM ...@@ -191,6 +194,14 @@ 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)
pr_geohash (~> 1.0)
rsolr (~> 1.0.7)
sunspot_rails (2.2.0)
nokogiri
rails (>= 3)
sunspot (= 2.2.0)
sunspot_solr (2.2.0)
thor (0.19.1) thor (0.19.1)
thread_safe (0.3.5) thread_safe (0.3.5)
tilt (1.4.1) tilt (1.4.1)
...@@ -236,6 +247,8 @@ DEPENDENCIES ...@@ -236,6 +247,8 @@ DEPENDENCIES
sass-rails (~> 5.0) sass-rails (~> 5.0)
sdoc (~> 0.4.0) sdoc (~> 0.4.0)
spring spring
sunspot_rails
sunspot_solr
turbolinks turbolinks
uglifier (>= 1.3.0) uglifier (>= 1.3.0)
vacuum vacuum
......
...@@ -8,6 +8,24 @@ ...@@ -8,6 +8,24 @@
box-sizing: border-box; box-sizing: border-box;
} }
select {
outline: 0;
overflow: hidden;
height: 30px;
background: #2c343c;
color: #747a80;
border: #2c343c;
padding: 5px 3px 5px 10px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 10px;
}
select option {border: 1px solid #000; background: #010;}
/* universal */ /* universal */
.container { .container {
padding-top: 10px; padding-top: 10px;
......
...@@ -7,16 +7,16 @@ class Admins::CartsController < ApplicationController ...@@ -7,16 +7,16 @@ class Admins::CartsController < ApplicationController
end end
def edit def edit
if admin_signed_in? && !params[:cart][:status].nil? && !params[:cart][:status].empty? if admin_signed_in? && !params[:status].nil? && !params[:status].empty?
@cart = Cart.find(params[:id]) @cart = Cart.find(params[:id])
if @cart.status == params[:cart][:status] if @cart.status == params[:status]
flash[:danger] = "Notthing change!" flash[:danger] = "Notthing change!"
redirect_to :back redirect_to action: :index
else else
@cart.status = params[:cart][:status] @cart.status = params[:status]
@cart.save @cart.save
flash[:success] = "Success!" flash[:success] = "Success!"
redirect_to :back redirect_to action: :index
end end
else else
flash[:danger] = "Notthing change!" flash[:danger] = "Notthing change!"
......
class Admins::ProductsController < ApplicationController class Admins::ProductsController < ApplicationController
def new def new
@product = Product.new if admin_signed_in?
@product = Product.new
else
flash[:danger] = "only admin!"
redirect_to root_path
end
end
def index
if admin_signed_in?
@products = Product.all
else
flash[:danger] = "only admin!"
redirect_to root_path
end
end end
def create def create
...@@ -19,15 +32,18 @@ class Admins::ProductsController < ApplicationController ...@@ -19,15 +32,18 @@ class Admins::ProductsController < ApplicationController
flash[:success] = "Success!" flash[:success] = "Success!"
redirect_to "/products/#{product.id}" redirect_to "/products/#{product.id}"
else else
flash[:danger] = "Wrong params!" flash[:danger] = "Wrong params! Please check name, price and image again."
redirect_to :action => :new redirect_to :action => :new
end end
else
flash[:danger] = "only admin!"
redirect_to root_path
end end
end end
def edit def edit
if admin_signed_in? if admin_signed_in?
if product_params[:price].to_i >= 0 && params[:category][:id].to_i > 0 && if product_params[:price].to_i > 0 && params[:category][:id].to_i > 0 &&
!product_params[:image].nil? && !product_params[:image].empty? && !product_params[:image].nil? && !product_params[:image].empty? &&
!product_params[:price].empty? && !product_params[:name].empty? && !product_params[:price].empty? && !product_params[:name].empty? &&
product_params[:price].to_i <= 999999 product_params[:price].to_i <= 999999
...@@ -41,9 +57,12 @@ class Admins::ProductsController < ApplicationController ...@@ -41,9 +57,12 @@ class Admins::ProductsController < ApplicationController
flash[:success] = "Success!" flash[:success] = "Success!"
redirect_to "/products/#{product.id}" redirect_to "/products/#{product.id}"
else else
flash[:danger] = "Wrong params!" flash[:danger] = "Wrong params! Please check name, price and image again."
redirect_to :action => :new redirect_to :back
end end
else
flash[:danger] = "only admin!"
redirect_to root_path
end end
end end
...@@ -53,16 +72,15 @@ class Admins::ProductsController < ApplicationController ...@@ -53,16 +72,15 @@ class Admins::ProductsController < ApplicationController
@product.destroy @product.destroy
flash[:success] = "Deleted!" flash[:success] = "Deleted!"
redirect_to :back redirect_to :back
else
flash[:danger] = "only admin!"
redirect_to root_path
end end
end end
def show def show
if params[:id].to_i > 0 if params[:id].to_i > 0 && admin_signed_in?
if @product = Product.find(params[:id])
@product = Product.find(params[:id])
else
flash[:danger] = "Only Admin"
end
else else
redirect_to :action => :new redirect_to :action => :new
end end
......
...@@ -3,11 +3,11 @@ class CartProductsController < ApplicationController ...@@ -3,11 +3,11 @@ class CartProductsController < ApplicationController
include CategoriesHelper include CategoriesHelper
def add def add
if params[:id].nil? || params[:quantity].nil? if params[:id].nil?
flash[:danger] = "Product not found!" flash[:danger] = "Product not found!"
redirect_to :action => :index elsif params[:quantity].nil? || params[:quantity].to_i <= 0
end flash[:danger] = "Wrong quantity"
if params[:quantity].to_i > 0 elsif params[:quantity].to_i > 0
id = params[:id] id = params[:id]
if session[:cart] then if session[:cart] then
cart_product = session[:cart] cart_product = session[:cart]
...@@ -15,15 +15,14 @@ class CartProductsController < ApplicationController ...@@ -15,15 +15,14 @@ class CartProductsController < ApplicationController
session[:cart] ={} session[:cart] ={}
cart_product = session[:cart] cart_product = session[:cart]
end end
if cart_product[id] then if cart_product[id] then
cart_product[id] = cart_product[id] + params[:quantity].to_i cart_product[id] = cart_product[id] + params[:quantity].to_i
else else
cart_product[id] = params[:quantity].to_i cart_product[id] = params[:quantity].to_i
end end
flash[:success] = "success" flash[:success] = "success"
redirect_to :back
end end
redirect_to :back
end end
def remove def remove
...@@ -32,10 +31,14 @@ class CartProductsController < ApplicationController ...@@ -32,10 +31,14 @@ class CartProductsController < ApplicationController
end end
def update def update
if params[:new_quantity].nil? || params[:id].nil? byebug
if params[:id].nil?
flash[:danger] = "Product not found!" flash[:danger] = "Product not found!"
elsif params[:new_quantity].nil? || params[:new_quantity].to_i <= 0
flash[:danger] = "Wrong quantity"
else else
session[:cart][params[:id].to_s] = params[:new_quantity].to_i session[:cart][params[:id].to_s] = params[:new_quantity].to_i
flash[:success] = "Update success"
end end
redirect_to :action => :index redirect_to :action => :index
end end
......
...@@ -8,15 +8,17 @@ class CartsController < ApplicationController ...@@ -8,15 +8,17 @@ class CartsController < ApplicationController
end end
def create def create
if !session[:cart].nil? if session[:cart].nil?
flash[:danger] = "Your cart Empty"
redirect_to :action => "show"
else
new_cart = Cart.new(cart_params) new_cart = Cart.new(cart_params)
new_cart.total_price = calculate_total_price new_cart.total_price = calculate_total_price
new_cart.status = "In process" new_cart.status = "In process"
if user_signed_in? if user_signed_in?
new_cart.user_id = current_user.id new_cart.user_id = current_user.id
end end
new_cart.save if new_cart.save
if !new_cart.id.nil?
session[:cart].each do |id, quantity| session[:cart].each do |id, quantity|
cart_product = CartProduct.new cart_product = CartProduct.new
cart_product.cart_id = new_cart.id cart_product.cart_id = new_cart.id
...@@ -28,9 +30,11 @@ class CartsController < ApplicationController ...@@ -28,9 +30,11 @@ class CartsController < ApplicationController
Emailer.send_email_to(cart_params[:mail].to_s,session[:cart]).deliver Emailer.send_email_to(cart_params[:mail].to_s,session[:cart]).deliver
flash[:success] = "Success!" flash[:success] = "Success!"
session[:cart] = nil session[:cart] = nil
else
flash[:danger] = "Your mail, your address, your name"
redirect_to :back
end end
end end
redirect_to :action => "show"
end end
def info def info
......
class CategoriesController < ApplicationController class CategoriesController < ApplicationController
include CategoriesHelper include CategoriesHelper
def index
@categories = Category.all
end
def show def show
if !Category.exists?(params[:id])
flash[:danger] = "Category not found!"
params[:id] = 1
else
params[:id]
end
category = Category.find(params[:id]) category = Category.find(params[:id])
@products = category.products @products = category.products
end end
......
...@@ -3,21 +3,32 @@ class ProductsController < ApplicationController ...@@ -3,21 +3,32 @@ class ProductsController < ApplicationController
include CategoriesHelper include CategoriesHelper
def index def index
if !params[:page] || (params[:page].to_i == 0)
params[:page] = 1
else
params[:page]
end
@products = Product.paginate(page: params[:page], :per_page => 50) @products = Product.paginate(page: params[:page], :per_page => 50)
@search_products = Product.new @search_products = Product.new
end end
def show def show
if !Product.find(params[:id]).nil? if !Product.exists?(params[:id])
@product = Product.find(params[:id])
else
flash[:danger] = "Product not found!" flash[:danger] = "Product not found!"
redirect_to root_path
else
@product = Product.find(params[:id])
end end
end end
def search def search
if params[:product][:search] if params[:search]
@products = Product.search(params[:product][:search]).paginate(page: params[:page], :per_page => 50) if !params[:page] || (params[:page].to_i == 0)
params[:page] = 1
else
params[:page]
end
@products = Product.search(params[:search]).paginate(page: params[:page], :per_page => 50)
flash[:success] = "Success!" flash[:success] = "Success!"
else else
flash[:danger] = "Danger!" flash[:danger] = "Danger!"
......
module ApplicationHelper module ApplicationHelper
end end
class Cart < ActiveRecord::Base class Cart < ActiveRecord::Base
validates :name, presence: true, length: { maximum: 255 } validates :name, presence: true, length: { maximum: 255 }
validates :address, presence: true, length: { maximum: 65000 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :mail, presence: true, length: { maximum: 255 }, validates :mail, presence: true, length: { maximum: 255 },
format: { with: VALID_EMAIL_REGEX } format: { with: VALID_EMAIL_REGEX }
......
...@@ -20,13 +20,17 @@ ...@@ -20,13 +20,17 @@
<td><%= cart.name.to_s %></td> <td><%= cart.name.to_s %></td>
<td><%= number_to_currency(cart.total_price/100, :unit => "$")%></td> <td><%= number_to_currency(cart.total_price/100, :unit => "$")%></td>
<td><%= cart.address %></td> <td><%= cart.address %></td>
<%= form_for(cart, url: "/admins/carts/#{cart.id}/edit" ,method: :get ) do |f| %> <td style="color-font:red;"><%= cart.status %></td>
<td><%= f.text_field :status, value: cart.status.to_s, size: 10 , class: "create_input" %> <form action= "/admins/carts/<%=cart.id%>/edit" style="padding-left : 0px ; resize: vertical;" >
</td> <td><select class="form-control" id="status" name="status">
<td> <option>In process</option>
<%= f.submit "Submit" , class: "btn btn-primary" %> <option>Pending</option>
</td> <option>Shipping</option>
<% end %> <option>Done</option>
</select></td>
<input type="hidden" value=this.form['status'] , class="btn btn-primary"/>
<td><input type="submit" value="Update" style="font-size: 1em;" , class="btn btn-primary"/></td>
</form>
</tr> </tr>
<% end -%> <% end -%>
</tbody> </tbody>
......
<% if admin_signed_in? %>
<div class="row">
<td> <%= link_to "Add product", "/admins/products/new", class: "btn btn-lg btn-primary" %></td>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Price</th>
<th></th>
</tr>
</thead>
<tbody>
<% @products.each do |product|%>
<tr>
<td><%= product.id.to_s %></td>
<td><%= product.name.to_s %></td>
<td><%= number_to_currency(product.price/100, :unit => "$")%></td>
<td> <%= link_to "Edit", "/admins/products/#{product.id}", class: "btn btn-lg btn-primary" %></td>
<td> <%= link_to "delete", "/admins/destroy/#{product.id}", class: "btn btn-lg btn-danger" %></td>
</tr>
<% end -%>
</tbody>
</table>
</div>
<% end %>
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<%= f.label :price %> <%= f.label :price %>
<%= f.number_field :price, value: "", class: 'form-control' %> <%= f.number_field :price, value: "", class: 'form-control' %>
</br>
<%= f.label :Category %> <%= f.label :Category %>
<%= collection_select :category, :id, Category.all, :id, :name %> <%= collection_select :category, :id, Category.all, :id, :name %>
</br> </br>
......
<h2>Log in Admin</h2> <h2>Log in Admin</h2>
<div class="col-md-12"> <% if user_signed_in? %>
<div class="center jumbotron"> <% flash[:danger] = "Only admin"%>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> <%else%>
<div class="field"> <div class="col-md-12">
<%= f.label :email %><br /> <div class="center jumbotron">
<%= f.email_field :email, autofocus: true %> <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
</div> <div class="field">
<%= f.label :email %><br />
<div class="field"> <%= f.email_field :email, autofocus: true %>
<%= f.label :password %><br /> </div>
<%= f.password_field :password, autocomplete: "off" %>
</div>
<% if devise_mapping.rememberable? -%>
<div class="field"> <div class="field">
<%= f.check_box :remember_me %> <%= f.label :password %><br />
<%= f.label :remember_me %> <%= f.password_field :password, autocomplete: "off" %>
</div> </div>
<% end -%>
<div class="actions"> <% if devise_mapping.rememberable? -%>
<%= f.submit "Log in" %> <div class="field">
</div> <%= f.check_box :remember_me %>
<% end %> <%= f.label :remember_me %>
</div> </div>
</div> <% end -%>
<%= render "admins/shared/links" %> <div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>
</div>
</div>
<%= render "admins/shared/links" %>
<% end -%>
...@@ -22,3 +22,4 @@ ...@@ -22,3 +22,4 @@
<%= link_to "Pay", "/cart", class: "btn btn-lg btn-danger"%> <%= link_to "Pay", "/cart", class: "btn btn-lg btn-danger"%>
<%= link_to "info", "/carts", class: "btn btn-lg btn-success"%> <%= link_to "info", "/carts", class: "btn btn-lg btn-success"%>
</ul> </ul>
<a href="/carts/show" class="glyphicon glyphicon-shopping-cart">Ordered cart</a>
\ No newline at end of file
<h1>Your Cart</h1>
<div class="col-md-3"> <div class="col-md-3">
<% if !admin_signed_in? %> <% if !admin_signed_in? %>
<%= render 'layouts/cart' %> <%= render 'layouts/cart' %>
...@@ -6,6 +5,7 @@ ...@@ -6,6 +5,7 @@
<% end %> <% end %>
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
<h1>Your Cart</h1>
<div class="col-md-12"> <div class="col-md-12">
<form class="navbar-left" style="padding-left: 0px" > <form class="navbar-left" style="padding-left: 0px" >
<%= link_to "Empty Cart" ,'/cart_product/clear' %> <%= link_to "Empty Cart" ,'/cart_product/clear' %>
......
<h1>Show cart</h1>
<div class="col-md-3" style=" padding-top: 50px;"> <div class="col-md-3" style=" padding-top: 50px;">
<% if !admin_signed_in? %>
<%= render 'layouts/cart' %> <%= render 'layouts/cart' %>
<%= render 'categories/view' %> <%= render 'categories/view' %>
<% end %>
</div> </div>
<div class="col-md-9" style=" padding-top: 50px;"> <div class="col-md-9" style=" padding-top: 50px;">
<ul> <ul>
......
<div class="col-md-3" style=" padding-top: 50px;">
<%= render 'layouts/cart' %>
<%= render 'categories/view' %>
</div>
<div class="col-md-9" style=" padding-top: 50px;">
<ul>
<% if !@categories.nil? %>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th></th>
</tr>
</thead>
<tbody>
<% @categories.each do |category|%>
<tr>
<td><%= category.id.to_s %></td>
<td><%= link_to category.name, "/categories/#{category.id}" %></td>
</tr>
<% end -%>
</tbody>
</table>
<% else -%>
<h2> Your cart Empty </h2>
<% end -%>
</ul>
</div>
<div class="col-md-3" > <div class="col-md-3" >
<% if !admin_signed_in? %> <% if !admin_signed_in? %>
<%= render 'layouts/cart' %> <%= render 'layouts/cart' %>
...@@ -12,13 +13,15 @@ ...@@ -12,13 +13,15 @@
<h5><%= truncate(product.name, length: 22) %></h5> <h5><%= truncate(product.name, length: 22) %></h5>
<%= (product.price/100.to_f).to_s + "$" %> <%= (product.price/100.to_f).to_s + "$" %>
</br> </br>
<% if admin_signed_in? %> <div>
<%= link_to "Edit", "/admins/products/#{product.id}", class: "btn btn-lg btn-primary" %> <form action="/cart_products" style="padding-left : 0px" >
<%= link_to "delete", "/admins/destroy/#{product.id}", class: "btn btn-lg btn-danger" %> <input type="number" name="quantity" value= "1" min="1" max="100">
<%else %> </br>
<%= link_to "Info", "/products/#{product.id}", class: "btn btn-lg btn-info" %> <input type="submit" value="Add" class = "btn btn-lg btn-success" />
<%= link_to "Buy", "/products/#{product.id}", class: "btn btn-lg btn-danger" %> <%= link_to "Detail", "/products/#{product.id}", class: "btn btn-lg btn-info" %>
<%end %> <input type="hidden" name="id" value="<%= product.id %>"/>
</form>
</div>
</div> </div>
</div> </div>
<% end -%> <% end -%>
......
<h2>Sign up Devise</h2> <h2>Sign up Devise</h2>
<div class="col-md-12"> <% if user_signed_in? || admin_signed_in? %>
<div class="center jumbotron"> <%flash[:danger] = "Signed in"%>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> <%else%>
<%= devise_error_messages! %> <div class="col-md-12">
<div class="center jumbotron">
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div class="field"> <div class="field">
<%= f.label :email %><br /> <%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %> <%= f.email_field :email, autofocus: true %>
</div> </div>
<div class="field"> <div class="field">
<%= f.label :password %> <%= f.label :password %>
<% if @minimum_password_length %> <% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em> <em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br /> <% end %><br />
<%= f.password_field :password, autocomplete: "off" %> <%= f.password_field :password, autocomplete: "off" %>
</div> </div>
<div class="field"> <div class="field">
<%= f.label :password_confirmation %><br /> <%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %> <%= f.password_field :password_confirmation, autocomplete: "off" %>
</div> </div>
<div class="actions"> <div class="actions">
<%= f.submit "Sign up" %> <%= f.submit "Sign up" %>
</div> </div>
<% end %> <% end %>
</div>
</div> </div>
</div> <%= render "devise/shared/links" %>
<%end%>
\ No newline at end of file
<%= render "devise/shared/links" %>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<h3><%=link_to("Home", root_path )%></h3> <h3><%=link_to("Home", root_path )%></h3>
</li> </li>
<li> <li>
<h3><%=link_to("Products", new_admins_product_path )%></h3> <h3><%=link_to("Products", '/admins/products' )%></h3>
</li> </li>
<li> <li>
<h3><%=link_to("Carts", '/admins/carts' )%></h3> <h3><%=link_to("Carts", '/admins/carts' )%></h3>
......
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
<div class="container-fluid"> <div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display --> <!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header"> <div class="navbar-header">
<a class="navbar-brand" href= "/" > Venshop </a> <table>
<td><a class="navbar-brand" href= "/" > Venshop </a></td>
<form action= "/search" style="padding-left : 100px ; resize: vertical;" method="get" class="navbar-brand" >
<td ><input type="text" name="search" value="" , class="form-control"/></td>
<td style="padding-left : 20px" ><input type="submit" value="Search" style="font-size: 1em;" , class="btn btn-primary"/></td>
</form>
</table>
</div> </div>
<!-- Collect the nav links, forms, and other content for toggling --> <!-- Collect the nav links, forms, and other content for toggling -->
...@@ -12,6 +18,7 @@ ...@@ -12,6 +18,7 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<% if user_signed_in? || admin_signed_in? %> <% if user_signed_in? || admin_signed_in? %>
<li> <li>
<li>
<span class="glyphicon glyphicon-log-out"> <span class="glyphicon glyphicon-log-out">
<%= link_to "Log out", destroy_user_session_path, method: "delete" %> <%= link_to "Log out", destroy_user_session_path, method: "delete" %>
</span> </span>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<% @products.each do |product| %> <% @products.each do |product| %>
<div class="col-md-4" style="padding-top : 20px"> <div class="col-md-4" style="padding-top : 20px">
<div> <div>
<%= image_tag(product.image, size: "180x230")%> <%= image_tag(product.image, size: "200x250")%>
<%= simple_format(truncate(product.name, length:21)) %> <%= simple_format(truncate(product.name, length:21)) %>
</div> </div>
<div> <div>
......
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
<% @products.each do |product| %> <% @products.each do |product| %>
<div class="col-md-4" style="padding-top : 20px"> <div class="col-md-4" style="padding-top : 20px">
<div> <div>
<%= image_tag(product.image, size: "180x230")%> <%= image_tag(product.image, size: "200x250")%>
<%= simple_format(truncate(product.name, length:21)) %> <%= simple_format(truncate(product.name, length:21)) %>
<%= (product.price/100.to_f).to_s + "$" %> <%= (product.price/100.to_f).to_s + "$" %>
</div> </div>
<div> <div>
<form action="/cart_products" style="padding-left : 0px" > <form action="/cart_products" style="padding-left : 0px" >
<input type="number" name="quantity" value= "1" min="1" max="100"> <input type="number" name="quantity" value= "1" min="1" max="100">
</br> </br>
<input type="submit" value="Add" class = "btn btn-lg btn-success" /> <input type="submit" value="Add" class = "btn btn-lg btn-success" />
<%= link_to "Detail", "/products/#{product.id}", class: "btn btn-lg btn-info" %> <%= link_to "Detail", "/products/#{product.id}", class: "btn btn-lg btn-info" %>
<input type="hidden" name="id" value="<%= product.id %>"/> <input type="hidden" name="id" value="<%= product.id %>"/>
</form> </form>
</div> </div>
</div> </div>
<% end %> <% end %>
</div> </div>
......
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<% if !admin_signed_in? %>
<%= render 'layouts/cart' %> <%= render 'layouts/cart' %>
<% end %>
<%= render 'categories/view' %> <%= render 'categories/view' %>
</div> </div>
<div class="col-md-9" > <div class="col-md-9" >
<div class="form-group"> <div class="form-group">
<table class="table">
<tr>
<%= form_for(@search_products, url: "search", method: :get) do |f| %>
<th class="col-md-6">
<%= f.text_field :search, value: "" ,class: 'form-control' %>
</th>
<th>
<%= f.submit "Search" , class: "btn btn-primary" %>
</th>
<% end %>
</tr>
</table>
</div>
<% if admin_signed_in? %>
<%= render 'products/admin_products' %>
<% else %>
<%= render 'products/custom_products' %> <%= render 'products/custom_products' %>
<% end %>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -5,10 +5,6 @@ ...@@ -5,10 +5,6 @@
<% end %> <% end %>
</div> </div>
<div class="col-md-9" > <div class="col-md-9" >
<% if admin_signed_in? %>
<%= render 'products/admin_products' %>
<% else %>
<%= render 'products/custom_products' %> <%= render 'products/custom_products' %>
<% end %>
</div> </div>
</div> </div>
\ No newline at end of file
<h2>Log in user</h2> <h2>Log in user</h2>
<div class="col-md-12"> <% if user_signed_in? || admin_signed_in? %>
<div class="center jumbotron"> <%flash[:danger] = "Signed in"%>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> <%else%>
<div class="field"> <div class="col-md-12">
<%= f.label :email %><br /> <div class="center jumbotron">
<%= f.email_field :email, autofocus: true %> <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
</div> <div class="field">
<%= f.label :email %><br />
<div class="field"> <%= f.email_field :email, autofocus: true %>
<%= f.label :password %><br /> </div>
<%= f.password_field :password, autocomplete: "off" %>
</div>
<% if devise_mapping.rememberable? -%>
<div class="field"> <div class="field">
<%= f.check_box :remember_me %> <%= f.label :password %><br />
<%= f.label :remember_me %> <%= f.password_field :password, autocomplete: "off" %>
</div> </div>
<% end -%>
<div class="actions"> <% if devise_mapping.rememberable? -%>
<%= f.submit "Log in" %> <div class="field">
</div> <%= f.check_box :remember_me %>
<% end %> <%= f.label :remember_me %>
</div> </div>
</div> <% end -%>
<%= render "users/shared/links" %> <div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>
</div>
</div>
<%= render "users/shared/links" %>
<% end -%>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
get '/admins/destroy/:id' => 'admins/products#destroy', as: 'destroy_product' get '/admins/destroy/:id' => 'admins/products#destroy', as: 'destroy_product'
get '/admins/carts' => 'admins/carts#index' , as: 'admins_carts_index' get '/admins/carts' => 'admins/carts#index' , as: 'admins_carts_index'
get '/admins/users' => 'admins/users#index' get '/admins/users' => 'admins/users#index'
get '/admins/search' =>'products#search'
patch "/admins/products/:id/edit"=>'admins/products#edit' patch "/admins/products/:id/edit"=>'admins/products#edit'
patch "/admins/carts/:id/edit" => 'admins/carts#edit' patch "/admins/carts/:id/edit" => 'admins/carts#edit'
......
<!--
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
<?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.
-->
<!--
This is the Solr schema file. This file should be named "schema.xml" and
should be in the conf directory under the solr home
(i.e. ./solr/conf/schema.xml by default)
or located where the classloader for the Solr webapp can find it.
This example schema is the recommended starting point for users.
It should be kept correct and concise, usable out-of-the-box.
For more information, on how to customize this file, please see
http://wiki.apache.org/solr/SchemaXml
PERFORMANCE NOTE: this schema includes many optional features and should not
be used for benchmarking. To improve performance one could
- set stored="false" for all fields possible (esp large fields) when you
only need to search on the field but don't need to return the original
value.
- set indexed="false" if you don't need to search on the field, but only
return the field as a result of searching on other indexed fields.
- remove all unneeded copyField statements
- for best index size and searching performance, set "index" to false
for all general text fields, use copyField to copy them to the
catchall "text" field, and use that for searching.
- For maximum indexing performance, use the StreamingUpdateSolrServer
java client.
- Remember to run the JVM in server mode, and use a higher logging level
that avoids logging every request
-->
<schema name="sunspot" version="1.0">
<types>
<!-- field type definitions. The "name" attribute is
just a label to be used by field definitions. The "class"
attribute and any other attributes determine the real
behavior of the fieldType.
Class names starting with "solr" refer to java classes in the
org.apache.solr.analysis package.
-->
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="string" class="solr.StrField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="tdouble" class="solr.TrieDoubleField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="rand" class="solr.RandomSortField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="text" class="solr.TextField" omitNorms="false">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="boolean" class="solr.BoolField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="date" class="solr.DateField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="sdouble" class="solr.SortableDoubleField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="sfloat" class="solr.SortableFloatField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="sint" class="solr.SortableIntField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="slong" class="solr.SortableLongField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="tint" class="solr.TrieIntField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="tfloat" class="solr.TrieFloatField" omitNorms="true"/>
<!-- *** This fieldType is used by Sunspot! *** -->
<fieldType name="tdate" class="solr.TrieDateField"
omitNorms="true"/>
<!-- Special field type for spell correction. Be careful about
adding filters here, as they apply *before* your values go in
the spellcheck. For example, the lowercase filter here means
all spelling suggestions will be lower case (without it,
though, you'd have duplicate suggestions for lower and proper
cased words). -->
<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" omitNorms="true">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
</types>
<fields>
<!-- Valid attributes for fields:
name: mandatory - the name for the field
type: mandatory - the name of a previously defined type from the
<types> section
indexed: true if this field should be indexed (searchable or sortable)
stored: true if this field should be retrievable
compressed: [false] if this field should be stored using gzip compression
(this will only apply if the field type is compressable; among
the standard field types, only TextField and StrField are)
multiValued: true if this field may contain multiple values per document
omitNorms: (expert) set to true to omit the norms associated with
this field (this disables length normalization and index-time
boosting for the field, and saves some memory). Only full-text
fields or fields that need an index-time boost need norms.
termVectors: [false] set to true to store the term vector for a
given field.
When using MoreLikeThis, fields used for similarity should be
stored for best performance.
termPositions: Store position information with the term vector.
This will increase storage costs.
termOffsets: Store offset information with the term vector. This
will increase storage costs.
default: a value that should be used if no value is specified
when adding a document.
-->
<!-- *** This field is used by Sunspot! *** -->
<field name="id" stored="true" type="string" multiValued="false" indexed="true"/>
<!-- *** This field is used by Sunspot! *** -->
<field name="type" stored="false" type="string" multiValued="true" indexed="true"/>
<!-- *** This field is used by Sunspot! *** -->
<field name="class_name" stored="false" type="string" multiValued="false" indexed="true"/>
<!-- *** This field is used by Sunspot! *** -->
<field name="text" stored="false" type="string" multiValued="true" indexed="true"/>
<!-- *** This field is used by Sunspot! *** -->
<field name="lat" stored="true" type="tdouble" multiValued="false" indexed="true"/>
<!-- *** This field is used by Sunspot! *** -->
<field name="lng" stored="true" type="tdouble" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="random_*" stored="false" type="rand" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="_local*" stored="false" type="tdouble" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_text" stored="false" type="text" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_texts" stored="true" type="text" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_b" stored="false" type="boolean" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_bm" stored="false" type="boolean" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_bs" stored="true" type="boolean" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_bms" stored="true" type="boolean" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_d" stored="false" type="date" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_dm" stored="false" type="date" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ds" stored="true" type="date" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_dms" stored="true" type="date" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_e" stored="false" type="sdouble" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_em" stored="false" type="sdouble" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_es" stored="true" type="sdouble" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ems" stored="true" type="sdouble" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_f" stored="false" type="sfloat" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_fm" stored="false" type="sfloat" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_fs" stored="true" type="sfloat" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_fms" stored="true" type="sfloat" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_i" stored="false" type="sint" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_im" stored="false" type="sint" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_is" stored="true" type="sint" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ims" stored="true" type="sint" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_l" stored="false" type="slong" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_lm" stored="false" type="slong" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ls" stored="true" type="slong" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_lms" stored="true" type="slong" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_s" stored="false" type="string" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_sm" stored="false" type="string" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ss" stored="true" type="string" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_sms" stored="true" type="string" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_it" stored="false" type="tint" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_itm" stored="false" type="tint" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_its" stored="true" type="tint" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_itms" stored="true" type="tint" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ft" stored="false" type="tfloat" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ftm" stored="false" type="tfloat" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_fts" stored="true" type="tfloat" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ftms" stored="true" type="tfloat" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_dt" stored="false" type="tdate" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_dtm" stored="false" type="tdate" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_dts" stored="true" type="tdate" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_dtms" stored="true" type="tdate" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_textv" stored="false" termVectors="true" type="text" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_textsv" stored="true" termVectors="true" type="text" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_et" stored="false" termVectors="true" type="tdouble" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_etm" stored="false" termVectors="true" type="tdouble" multiValued="true" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_ets" stored="true" termVectors="true" type="tdouble" multiValued="false" indexed="true"/>
<!-- *** This dynamicField is used by Sunspot! *** -->
<dynamicField name="*_etms" stored="true" termVectors="true" type="tdouble" multiValued="true" indexed="true"/>
<!-- Type used to index the lat and lon components for the "location" FieldType -->
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false" multiValued="false"/>
<dynamicField name="*_p" type="location" indexed="true" stored="true" multiValued="false"/>
<dynamicField name="*_ll" stored="false" type="location" multiValued="false" indexed="true"/>
<dynamicField name="*_llm" stored="false" type="location" multiValued="true" indexed="true"/>
<dynamicField name="*_lls" stored="true" type="location" multiValued="false" indexed="true"/>
<dynamicField name="*_llms" stored="true" type="location" multiValued="true" indexed="true"/>
<field name="textSpell" stored="false" type="textSpell" multiValued="true" indexed="true"/>
<!-- required by Solr 4 -->
<field name="_version_" type="string" indexed="true" stored="true" multiValued="false" />
</fields>
<!-- Field to use to determine and enforce document uniqueness.
Unless this field is marked with required="false", it will be a required field
-->
<uniqueKey>id</uniqueKey>
<!-- field for the QueryParser to use when an explicit fieldname is absent -->
<defaultSearchField>text</defaultSearchField>
<!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
<solrQueryParser defaultOperator="AND"/>
<!-- copyField commands copy one field to another at the time a document
is added to the index. It's used either to index the same field differently,
or to add multiple fields to the same field for easier/faster
searching. -->
<!-- Use copyField to copy the fields you want to run spell checking
on into one field. For example: -->
<copyField source="*_text" dest="textSpell" />
<copyField source="*_s" dest="textSpell" />
</schema>
# 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=
<?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.
-->
<!--
For more details about configurations options that may appear in
this file, see http://wiki.apache.org/solr/SolrConfigXml.
-->
<config>
<!-- In all configuration below, a prefix of "solr." for class names
is an alias that causes solr to search appropriate packages,
including org.apache.solr.(search|update|request|core|analysis)
You may also specify a fully qualified Java classname if you
have your own custom plugins.
-->
<!-- Controls what version of Lucene various components of Solr
adhere to. Generally, you want to use the latest version to
get all bug fixes and improvements. It is highly recommended
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
<luceneMatchVersion>LUCENE_41</luceneMatchVersion>
<!-- <lib/> directives can be used to instruct Solr to load an Jars
identified and use them to resolve any "plugins" specified in
your solrconfig.xml or schema.xml (ie: Analyzers, Request
Handlers, etc...).
All directories and paths are resolved relative to the
instanceDir.
Please note that <lib/> directives are processed in the order
that they appear in your solrconfig.xml file, and are "stacked"
on top of each other when building a ClassLoader - so if you have
plugin jars with dependencies on other jars, the "lower level"
dependency jars should be loaded first.
If a "./lib" directory exists in your instanceDir, all files
found in it are included as if you had used the following
syntax...
<lib dir="./lib" />
-->
<dataDir>${solr.data.dir:}</dataDir>
<!-- The DirectoryFactory to use for indexes.
solr.StandardDirectoryFactory is filesystem
based and tries to pick the best implementation for the current
JVM and platform. solr.NRTCachingDirectoryFactory, the default,
wraps solr.StandardDirectoryFactory and caches small files in memory
for better NRT performance.
One can force a particular implementation via solr.MMapDirectoryFactory,
solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
solr.RAMDirectoryFactory is memory based, not
persistent, and doesn't work with replication.
-->
<directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index Config - These settings control low-level behavior of indexing
Most example settings here show the default value, but are commented
out, to more easily see where customizations have been made.
Note: This replaces <indexDefaults> and <mainIndex> from older versions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<indexConfig>
<!-- maxFieldLength was removed in 4.0. To get similar behavior, include a
LimitTokenCountFilterFactory in your fieldType definition. E.g.
<filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
-->
<!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
<!-- <writeLockTimeout>1000</writeLockTimeout> -->
<!-- The maximum number of simultaneous threads that may be
indexing documents at once in IndexWriter; if more than this
many threads arrive they will wait for others to finish.
Default in Solr/Lucene is 8. -->
<maxIndexingThreads>2</maxIndexingThreads>
<useCompoundFile>true</useCompoundFile>
<!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
indexing for buffering added documents and deletions before they are
flushed to the Directory.
maxBufferedDocs sets a limit on the number of documents buffered
before flushing.
If both ramBufferSizeMB and maxBufferedDocs is set, then
Lucene will flush based on whichever limit is hit first. -->
<ramBufferSizeMB>20</ramBufferSizeMB> -->
<maxBufferedDocs>10000</maxBufferedDocs>
<!-- Expert: Merge Policy
The Merge Policy in Lucene controls how merging of segments is done.
The default since Solr/Lucene 3.3 is TieredMergePolicy.
The default since Lucene 2.3 was the LogByteSizeMergePolicy,
Even older versions of Lucene used LogDocMergePolicy.
-->
<mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
<int name="maxMergeAtOnce">4</int>
<int name="segmentsPerTier">4</int>
</mergePolicy>
<unlockOnStartup>true</unlockOnStartup>
</indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
<!-- Enables a transaction log, used for real-time get, durability, and
and solr cloud replica recovery. The log can grow as big as
uncommitted changes to the index, so use of a hard autoCommit
is recommended (see below).
"dir" - the target directory for transaction logs, defaults to the
solr data directory. -->
<updateLog>
<str name="dir">${solr.ulog.dir:}</str>
</updateLog>
<autoCommit>
<maxTime>15000</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<autoSoftCommit>
<maxTime>5000</maxTime>
</autoSoftCommit>
</updateHandler>
<query>
<maxBooleanClauses>1024</maxBooleanClauses>
<!-- Solr Internal Query Caches
There are two implementations of cache available for Solr,
LRUCache, based on a synchronized LinkedHashMap, and
FastLRUCache, based on a ConcurrentHashMap.
FastLRUCache has faster gets and slower puts in single
threaded operation and thus is generally faster than LRUCache
when the hit ratio of the cache is high (> 75%), and may be
faster under other scenarios on multi-cpu systems.
-->
<!-- Filter Cache
Cache used by SolrIndexSearcher for filters (DocSets),
unordered sets of *all* documents that match a query. When a
new searcher is opened, its caches may be prepopulated or
"autowarmed" using data from caches in the old searcher.
autowarmCount is the number of items to prepopulate. For
LRUCache, the autowarmed items will be the most recently
accessed items.
Parameters:
class - the SolrCache implementation LRUCache or
(LRUCache or FastLRUCache)
size - the maximum number of entries in the cache
initialSize - the initial capacity (number of entries) of
the cache. (see java.util.HashMap)
autowarmCount - the number of entries to prepopulate from
and old cache.
-->
<filterCache class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- Query Result Cache
Caches results of searches - ordered lists of document ids
(DocList) based on a query, a sort, and the range of documents requested.
-->
<queryResultCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- Document Cache
Caches Lucene Document objects (the stored fields for each
document). Since Lucene internal document ids are transient,
this cache will not be autowarmed.
-->
<documentCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- Lazy Field Loading
If true, stored fields that are not requested will be loaded
lazily. This can result in a significant speed improvement
if the usual case is to not load all stored fields,
especially if the skipped fields are large compressed text
fields.
-->
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<!-- Use Filter For Sorted Query
A possible optimization that attempts to use a filter to
satisfy a search. If the requested sort does not include
score, then the filterCache will be checked for a filter
matching the query. If found, the filter will be used as the
source of document ids, and then the sort will be applied to
that.
For most situations, this will not be useful unless you
frequently get the same search repeatedly with different sort
options, and none of them ever use "score"
-->
<!--
<useFilterForSortedQuery>true</useFilterForSortedQuery>
-->
<!-- Result Window Size
An optimization for use with the queryResultCache. When a search
is requested, a superset of the requested number of document ids
are collected. For example, if a search for a particular query
requests matching documents 10 through 19, and queryWindowSize is 50,
then documents 0 through 49 will be collected and cached. Any further
requests in that range can be satisfied via the cache.
-->
<queryResultWindowSize>20</queryResultWindowSize>
<!-- Maximum number of documents to cache for any entry in the
queryResultCache.
-->
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
<!-- Query Related Event Listeners
Various IndexSearcher related events can trigger Listeners to
take actions.
newSearcher - fired whenever a new searcher is being prepared
and there is a current searcher handling requests (aka
registered). It can be used to prime certain caches to
prevent long request times for certain requests.
firstSearcher - fired whenever a new searcher is being
prepared but there is no current registered searcher to handle
requests or to gain autowarming data from.
-->
<!-- Use Cold Searcher
If a search request comes in and there is no current
registered searcher, then immediately register the still
warming searcher and use it. If "false" then all requests
will block until the first searcher is done warming.
-->
<useColdSearcher>false</useColdSearcher>
<!-- Max Warming Searchers
Maximum number of searchers that may be warming in the
background concurrently. An error is returned if this limit
is exceeded.
Recommend values of 1-2 for read-only slaves, higher for
masters w/o cache warming.
-->
<maxWarmingSearchers>5</maxWarmingSearchers>
</query>
<!-- Request Dispatcher
This section contains instructions for how the SolrDispatchFilter
should behave when processing requests for this SolrCore.
handleSelect is a legacy option that affects the behavior of requests
such as /select?qt=XXX
handleSelect="true" will cause the SolrDispatchFilter to process
the request and dispatch the query to a handler specified by the
"qt" param, assuming "/select" isn't already registered.
handleSelect="false" will cause the SolrDispatchFilter to
ignore "/select" requests, resulting in a 404 unless a handler
is explicitly registered with the name "/select"
handleSelect="true" is not recommended for new users, but is the default
for backwards compatibility
-->
<requestDispatcher handleSelect="false" >
<!-- Request Parsing
These settings indicate how Solr Requests may be parsed, and
what restrictions may be placed on the ContentStreams from
those requests
enableRemoteStreaming - enables use of the stream.file
and stream.url parameters for specifying remote streams.
multipartUploadLimitInKB - specifies the max size (in KiB) of
Multipart File Uploads that Solr will allow in a Request.
formdataUploadLimitInKB - specifies the max size (in KiB) of
form data (application/x-www-form-urlencoded) sent via
POST. You can use POST to pass request parameters not
fitting into the URL.
*** WARNING ***
The settings below authorize Solr to fetch remote files, You
should make sure your system has some authentication before
using enableRemoteStreaming="true"
-->
<!-- HTTP Caching
Set HTTP caching related parameters (for proxy caches and clients).
The options below instruct Solr not to output any HTTP Caching
related headers
-->
<httpCaching never304="true" />
<!-- If you include a <cacheControl> directive, it will be used to
generate a Cache-Control header (as well as an Expires header
if the value contains "max-age=")
By default, no Cache-Control header is generated.
You can use the <cacheControl> option even if you have set
never304="true"
-->
<!--
<httpCaching never304="true" >
<cacheControl>max-age=30, public</cacheControl>
</httpCaching>
-->
<!-- To enable Solr to respond with automatically generated HTTP
Caching headers, and to response to Cache Validation requests
correctly, set the value of never304="false"
This will cause Solr to generate Last-Modified and ETag
headers based on the properties of the Index.
The following options can also be specified to affect the
values of these headers...
lastModFrom - the default value is "openTime" which means the
Last-Modified value (and validation against If-Modified-Since
requests) will all be relative to when the current Searcher
was opened. You can change it to lastModFrom="dirLastMod" if
you want the value to exactly correspond to when the physical
index was last modified.
etagSeed="..." is an option you can change to force the ETag
header (and validation against If-None-Match requests) to be
different even if the index has not changed (ie: when making
significant changes to your config file)
(lastModifiedFrom and etagSeed are both ignored if you use
the never304="true" option)
-->
<!--
<httpCaching lastModifiedFrom="openTime"
etagSeed="Solr">
<cacheControl>max-age=30, public</cacheControl>
</httpCaching>
-->
</requestDispatcher>
<!-- Request Handlers
http://wiki.apache.org/solr/SolrRequestHandler
Incoming queries will be dispatched to a specific handler by name
based on the path specified in the request.
Legacy behavior: If the request path uses "/select" but no Request
Handler has that name, and if handleSelect="true" has been specified in
the requestDispatcher, then the Request Handler is dispatched based on
the qt parameter. Handlers without a leading '/' are accessed this way
like so: http://host/app/[core/]select?qt=name If no qt is
given, then the requestHandler that declares default="true" will be
used or the one named "standard".
If a Request Handler is declared with startup="lazy", then it will
not be initialized until the first request that uses it.
-->
<!-- SearchHandler
http://wiki.apache.org/solr/SearchHandler
For processing Search Queries, the primary Request Handler
provided with Solr is "SearchHandler" It delegates to a sequent
of SearchComponents (see below) and supports distributed
queries across multiple shards
-->
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="spellcheck.dictionary">default</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.collate">true</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<!-- A request handler that returns indented JSON by default -->
<requestHandler name="/query" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="wt">json</str>
<str name="indent">true</str>
<str name="df">text</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<!-- realtime get handler, guaranteed to return the latest stored fields of
any document, without the need to commit or open a new searcher. The
current implementation relies on the updateLog feature being enabled. -->
<requestHandler name="/get" class="solr.RealTimeGetHandler">
<lst name="defaults">
<str name="omitHeader">true</str>
<str name="wt">json</str>
<str name="indent">true</str>
</lst>
</requestHandler>
<requestHandler name="/update" class="solr.UpdateRequestHandler">
</requestHandler>
<requestHandler name="/update/json" class="solr.JsonUpdateRequestHandler">
<lst name="defaults">
<str name="stream.contentType">application/json</str>
</lst>
</requestHandler>
<requestHandler name="/update/csv" class="solr.CSVRequestHandler">
<lst name="defaults">
<str name="stream.contentType">application/csv</str>
</lst>
</requestHandler>
<requestHandler name="/update/extract"
startup="lazy"
class="solr.extraction.ExtractingRequestHandler" >
<lst name="defaults">
<str name="lowernames">true</str>
<str name="uprefix">ignored_</str>
<!-- capture link hrefs but ignore div attributes -->
<str name="captureAttr">true</str>
<str name="fmap.a">links</str>
<str name="fmap.div">ignored_</str>
</lst>
</requestHandler>
<requestHandler name="/analysis/field"
startup="lazy"
class="solr.FieldAnalysisRequestHandler" />
<requestHandler name="/analysis/document"
class="solr.DocumentAnalysisRequestHandler"
startup="lazy" />
<!-- ping/healthcheck -->
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="echoHandler">true</str>
</lst>
</requestHandler>
<requestHandler name="/replication" class="solr.ReplicationHandler" >
</requestHandler>
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">textSpell</str>
<!-- Multiple "Spell Checkers" can be declared and used by this
component
-->
<lst name="spellchecker">
<str name="name">default</str>
<!-- change field to textSpell and use copyField in schema.xml
to spellcheck multiple fields -->
<str name="field">textSpell</str>
<str name="buildOnCommit">true</str>
</lst>
<lst name="spellchecker">
<str name="name">example</str>
<str name="field">title_text</str>
<str name="buildOnCommit">true</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<!-- the spellcheck distance measure used, the default is the internal levenshtein -->
<str name="distanceMeasure">internal</str>
<!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
<float name="accuracy">0.5</float>
<!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
<int name="maxEdits">2</int>
<!-- the minimum shared prefix when enumerating terms -->
<int name="minPrefix">1</int>
<!-- maximum number of inspections per result. -->
<int name="maxInspections">5</int>
<!-- minimum length of a query term to be considered for correction -->
<int name="minQueryLength">4</int>
<!-- maximum threshold of documents a query term can appear to be considered for correction -->
<float name="maxQueryFrequency">0.01</float>
<!-- uncomment this to require suggestions to occur in 1% of the documents
<float name="thresholdTokenFrequency">.01</float>
-->
</lst>
<!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
<lst name="spellchecker">
<str name="name">wordbreak</str>
<str name="classname">solr.WordBreakSolrSpellChecker</str>
<str name="field">name</str>
<str name="combineWords">true</str>
<str name="breakWords">true</str>
<int name="maxChanges">10</int>
</lst>
-->
</searchComponent>
<searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
<searchComponent name="terms" class="solr.TermsComponent"/>
<searchComponent class="solr.HighlightComponent" name="highlight">
<highlighting>
<!-- Configure the standard fragmenter -->
<!-- This could most likely be commented out in the "default" case -->
<fragmenter name="gap"
default="true"
class="solr.highlight.GapFragmenter">
<lst name="defaults">
<int name="hl.fragsize">100</int>
</lst>
</fragmenter>
<!-- A regular-expression-based fragmenter
(for sentence extraction)
-->
<fragmenter name="regex"
class="solr.highlight.RegexFragmenter">
<lst name="defaults">
<!-- slightly smaller fragsizes work better because of slop -->
<int name="hl.fragsize">70</int>
<!-- allow 50% slop on fragment sizes -->
<float name="hl.regex.slop">0.5</float>
<!-- a basic sentence pattern -->
<str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
</lst>
</fragmenter>
<!-- Configure the standard formatter -->
<formatter name="html"
default="true"
class="solr.highlight.HtmlFormatter">
<lst name="defaults">
<str name="hl.simple.pre"><![CDATA[<em>]]></str>
<str name="hl.simple.post"><![CDATA[</em>]]></str>
</lst>
</formatter>
<!-- Configure the standard encoder -->
<encoder name="html"
class="solr.highlight.HtmlEncoder" />
<!-- Configure the standard fragListBuilder -->
<fragListBuilder name="simple"
class="solr.highlight.SimpleFragListBuilder"/>
<!-- Configure the single fragListBuilder -->
<fragListBuilder name="single"
class="solr.highlight.SingleFragListBuilder"/>
<!-- Configure the weighted fragListBuilder -->
<fragListBuilder name="weighted"
default="true"
class="solr.highlight.WeightedFragListBuilder"/>
<!-- default tag FragmentsBuilder -->
<fragmentsBuilder name="default"
default="true"
class="solr.highlight.ScoreOrderFragmentsBuilder">
<!--
<lst name="defaults">
<str name="hl.multiValuedSeparatorChar">/</str>
</lst>
-->
</fragmentsBuilder>
<!-- multi-colored tag FragmentsBuilder -->
<fragmentsBuilder name="colored"
class="solr.highlight.ScoreOrderFragmentsBuilder">
<lst name="defaults">
<str name="hl.tag.pre"><![CDATA[
<b style="background:yellow">,<b style="background:lawgreen">,
<b style="background:aquamarine">,<b style="background:magenta">,
<b style="background:palegreen">,<b style="background:coral">,
<b style="background:wheat">,<b style="background:khaki">,
<b style="background:lime">,<b style="background:deepskyblue">]]></str>
<str name="hl.tag.post"><![CDATA[</b>]]></str>
</lst>
</fragmentsBuilder>
<boundaryScanner name="default"
default="true"
class="solr.highlight.SimpleBoundaryScanner">
<lst name="defaults">
<str name="hl.bs.maxScan">10</str>
<str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
</lst>
</boundaryScanner>
<boundaryScanner name="breakIterator"
class="solr.highlight.BreakIteratorBoundaryScanner">
<lst name="defaults">
<!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
<str name="hl.bs.type">WORD</str>
<!-- language and country are used when constructing Locale object. -->
<!-- And the Locale object will be used when getting instance of BreakIterator -->
<str name="hl.bs.language">en</str>
<str name="hl.bs.country">US</str>
</lst>
</boundaryScanner>
</highlighting>
</searchComponent>
<requestHandler class="solr.MoreLikeThisHandler" name="/mlt">
<lst name="defaults">
<str name="mlt.mintf">1</str>
<str name="mlt.mindf">2</str>
</lst>
</requestHandler>
<!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->
<requestHandler name="/admin/" class="solr.admin.AdminHandlers" />
</config>
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