1
0
Fork 0
forked from OpenNeo/impress
impress/app/flex/flex_search.yml
Matchu 6e09b8bc10 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-24 18:24:35 -06:00

45 lines
1.3 KiB
YAML

# Add here your search queries
# see the detailed Source documentation at https://github.com/ddnexus/flex/wiki/Sources
# ANCHORS litheral key: it will not be used as template
# you can store here fragments of queries to reuse in the templates below
ANCHORS:
- &name_locale_partial
"name.<<locale>>^<<boost= 1>>"
_name_locales:
*name_locale_partial
_negative_name_locales:
*name_locale_partial
item_search:
- query:
bool:
must:
- multi_match:
query: <<name= ~>>
fields: <<_name_locales>>
- term:
is_nc: <<is_nc= ~>>
- term:
is_pb: <<is_pb= ~>>
- term:
species_support_id: <<species_support_id= ~>>
- term:
occupied_zone_id: <<occupied_zone_id= ~>>
- term:
restricted_zone_id: <<restricted_zone_id= ~>>
must_not:
- term:
species_support_id: <<negative_species_support_id= ~>>
- term:
occupied_zone_id: <<negative_occupied_zone_id= ~>>
- term:
restricted_zone_id: <<negative_restricted_zone_id= ~>>
- multi_match:
query: <<negative_name= ~>>
fields: <<_negative_name_locales>>
sort:
- name.<<locale>>.untouched