globalized search first draft
Confirmed features:
* Output (retrieval, sorting, etc.)
* Name (positive and negative, but new behavior)
* Flags (positive and negative)
Planned features:
* users:owns, user:wants
Known issues:
* Sets are broken
* Don't render properly
* Shouldn't actually be done as joined sets, anyway, since
we actually want (set1_zone1 OR set1_zone2) AND
(set2_zone1 OR set2_zone2), which will require breaking
it into multiple terms queries.
* Name has regressed: ignores phrases, doesn't require *all*
words. While we're breaking sets into multiple queries,
maybe we'll do something similar for name. In fact, we
really kinda have to if we're gonna keep sorting by name,
since "straw hat" returns all hats. Eww.
2013-01-18 21:23:37 -08:00
|
|
|
# ANCHORS litheral key: it will not be used as template
|
|
|
|
# you can store here fragments of structures to reuse below
|
|
|
|
ANCHORS:
|
|
|
|
-
|
|
|
|
|
|
|
|
# This is a dynamic index name The settings and mapping below will work with any index.
|
|
|
|
# The default index name generated by Flex is usually <application_name>_<environment>,
|
|
|
|
# but you may have changed it in the initializers/flex.rb or you can hardcode it if you prefer.
|
|
|
|
<%= Flex::Configuration.variables[:index] %>:
|
|
|
|
|
|
|
|
settings:
|
|
|
|
number_of_shards: 5
|
|
|
|
number_of_replicas: 1
|
2013-01-29 21:00:45 -08:00
|
|
|
|
|
|
|
analysis:
|
|
|
|
analyzer:
|
|
|
|
item_name_index:
|
|
|
|
type: custom
|
|
|
|
tokenizer: item_name
|
|
|
|
filter:
|
|
|
|
- lowercase
|
|
|
|
- asciifolding
|
|
|
|
|
|
|
|
item_name_search:
|
|
|
|
type: custom
|
|
|
|
tokenizer: keyword
|
|
|
|
filter:
|
|
|
|
- lowercase
|
|
|
|
- asciifolding
|
|
|
|
|
|
|
|
tokenizer:
|
|
|
|
item_name:
|
|
|
|
type: ngram
|
|
|
|
min_gram: 3
|
|
|
|
max_gram: 16
|
globalized search first draft
Confirmed features:
* Output (retrieval, sorting, etc.)
* Name (positive and negative, but new behavior)
* Flags (positive and negative)
Planned features:
* users:owns, user:wants
Known issues:
* Sets are broken
* Don't render properly
* Shouldn't actually be done as joined sets, anyway, since
we actually want (set1_zone1 OR set1_zone2) AND
(set2_zone1 OR set2_zone2), which will require breaking
it into multiple terms queries.
* Name has regressed: ignores phrases, doesn't require *all*
words. While we're breaking sets into multiple queries,
maybe we'll do something similar for name. In fact, we
really kinda have to if we're gonna keep sorting by name,
since "straw hat" returns all hats. Eww.
2013-01-18 21:23:37 -08:00
|
|
|
|
|
|
|
# add your custom mappings here
|
|
|
|
mappings:
|
|
|
|
item:
|
|
|
|
properties:
|
|
|
|
# Name is an object of locale fields, which are in turn multi_fields.
|
|
|
|
# First, an analyzed string for searching. Second, an untouched
|
|
|
|
# string for sorting. Elasticsearch requires that both be expliticly
|
|
|
|
# named in the mapping, but will handle the copy implicitly.
|
|
|
|
name:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
<% I18n.usable_locales_with_neopets_language_code.each do |locale| %>
|
|
|
|
<%= locale %>:
|
|
|
|
type: multi_field
|
|
|
|
fields:
|
|
|
|
<%= locale %>:
|
|
|
|
type: string
|
|
|
|
index: analyzed
|
2013-01-29 21:00:45 -08:00
|
|
|
index_analyzer: item_name_index
|
|
|
|
search_analyzer: item_name_search
|
globalized search first draft
Confirmed features:
* Output (retrieval, sorting, etc.)
* Name (positive and negative, but new behavior)
* Flags (positive and negative)
Planned features:
* users:owns, user:wants
Known issues:
* Sets are broken
* Don't render properly
* Shouldn't actually be done as joined sets, anyway, since
we actually want (set1_zone1 OR set1_zone2) AND
(set2_zone1 OR set2_zone2), which will require breaking
it into multiple terms queries.
* Name has regressed: ignores phrases, doesn't require *all*
words. While we're breaking sets into multiple queries,
maybe we'll do something similar for name. In fact, we
really kinda have to if we're gonna keep sorting by name,
since "straw hat" returns all hats. Eww.
2013-01-18 21:23:37 -08:00
|
|
|
untouched:
|
|
|
|
type: string
|
|
|
|
index: not_analyzed
|
|
|
|
<% end %>
|