Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use Unicode properties for all letters and numbers, so nothing import…

…ant gets removed.
  • Loading branch information...
commit 5a5d2429185e3b007d7808816390b34f8d6cb3da 1 parent 95bb567
@rogerbraun authored
View
6 generators/prototypes/all_in_one/sinatra/app.rb
@@ -44,7 +44,7 @@ def each
#
books_index = Index.new :books do
source { Books.new }
- indexing removes_characters: /[^a-z0-9\s\/\-\_\:\"\&\.]/i,
+ indexing removes_characters: /[^\p{L}\p{N}\s\/\-\_\:\"\&\.]/i,
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\_\:\"\&\/]/
category :title,
@@ -64,7 +64,7 @@ def each
#
books = Search.new books_index do
searching substitutes_characters_with: CharacterSubstituters::WestEuropean.new, # Normalizes special user input, Ä -> Ae, ñ -> n etc.
- removes_characters: /[^a-z0-9\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
+ removes_characters: /[^\p{L}\p{N}\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\&]+/
@@ -129,4 +129,4 @@ def js path
end
-end
+end
View
6 generators/prototypes/server/sinatra/app.rb
@@ -31,7 +31,7 @@ def each
#
books_index = Index.new :books do
source { Books.new }
- indexing removes_characters: /[^a-z0-9\s\/\-\_\:\"\&\.]/i,
+ indexing removes_characters: /[^\p{L}\p{N}\s\/\-\_\:\"\&\.]/i,
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\_\:\"\&\/]/
category :title,
@@ -51,7 +51,7 @@ def each
#
books = Search.new books_index do
searching substitutes_characters_with: CharacterSubstituters::WestEuropean.new, # Normalizes special user input, Ä -> Ae, ñ -> n etc.
- removes_characters: /[^a-z0-9\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
+ removes_characters: /[^\p{L}\p{N}\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\&]+/
boost [:title, :author] => +3,
@@ -66,4 +66,4 @@ def each
results.to_json
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.