Difference between revisions of "Template:Card query"
(No need for another "parameter". Trying to make the search better by using regex.) |
|||
Line 2: | Line 2: | ||
-->{{ #vardefine: $query_query | {{{1}}} | -->{{ #vardefine: $query_query | {{{1}}} | ||
}}{{ #vardefine: $query_query_lc | {{ lc: {{ #var: $query_query }} }} | }}{{ #vardefine: $query_query_lc | {{ lc: {{ #var: $query_query }} }} | ||
+ | }}{{ #arraydefine: @check_query | {{ #var: $query_query_lc }} | ||
}}{{ #vardefine: $query_medium | {{ #switch: {{ lc: {{{medium}}} }} | }}{{ #vardefine: $query_medium | {{ #switch: {{ lc: {{{medium}}} }} | ||
| ocg | tcg | ocg/tcg | tcg/ocg | official = official | | ocg | tcg | ocg/tcg | tcg/ocg | official = official | ||
Line 74: | Line 75: | ||
}}{{ #vardefine: $query_col_attribute | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}attribute:: }} || ?Attribute = [[Attribute]] }} | }}{{ #vardefine: $query_col_attribute | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}attribute:: }} || ?Attribute = [[Attribute]] }} | ||
}}{{ #vardefine: $query_col_type | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}type:: }} || ?Type = [[Type]] }} | }}{{ #vardefine: $query_col_type | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}type:: }} || ?Type = [[Type]] }} | ||
− | }}{{ #vardefine: $query_col_stars | {{ #if: {{ # | + | }}<!-- |
− | + | -->{{ #vardefine: $query_col_stars | |
+ | | {{ #if: {{ #arraysearch: @check_query | /(\{{!(}}\{{!(}}\??(stars{{!}}level{{!}}rank){{!}}link monster)/ }} | ||
+ | | {{ #if: {{ #arraysearch: @check_query | /(stars{{!}}level{{!}}rank)::(<{{!}}>{{!}}\d\d?\{{!}}\{{!}}\d)/ }} | ||
+ | | ?Stars string = {{ #if: {{ #arraysearch: @check_query | /(xyz( pendulum)? monster)/ }} | ||
+ | | | ||
+ | | [[Level]]/ | ||
+ | }} [[Rank]] | ||
+ | }} | ||
+ | | ?Stars string = {{ #if: {{ #arraysearch: @check_query | /(xyz( pendulum)? monster)/ }} | ||
+ | | | ||
+ | | [[Level]]/ | ||
+ | }} [[Rank]] | ||
+ | }} | ||
+ | }}<!-- | ||
+ | -->{{ #vardefine: $query_col_scale | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | pendulum monster }} | ?Pendulum Scale = [[Pendulum Scale|Scale]] }} | ||
}}{{ #vardefine: $query_col_atk | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}atk }}{{ #pos: {{ #var: $query_query_lc }} | {{!((}}?atk }} || ?ATK string = [[ATK]] }} | }}{{ #vardefine: $query_col_atk | {{ #if: {{ #pos: {{ #var: $query_query_lc }} | {{!((}}atk }}{{ #pos: {{ #var: $query_query_lc }} | {{!((}}?atk }} || ?ATK string = [[ATK]] }} | ||
}}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | link monster }} | }}{{ #if: {{ #pos: {{ #var: $query_query_lc }} | link monster }} | ||
Line 98: | Line 113: | ||
we finally get to the actual query | we finally get to the actual query | ||
− | -- | + | -->{{ #ask: {{ #var: $query_medium_query }}{{ #var: $query_card_type_query }}{{ #var: $query_query }} |
|{{ #if: {{ #var: $query_query_medium | {{ #var: $query_medium }} }} | ?English name (linked) = }} | |{{ #if: {{ #var: $query_query_medium | {{ #var: $query_medium }} }} | ?English name (linked) = }} | ||
|?Japanese name | |?Japanese name | ||
Line 120: | Line 135: | ||
| {{ #if: {{ #var: $query_order }} | order = {{ #var: $query_order }} }} | | {{ #if: {{ #var: $query_order }} | order = {{ #var: $query_order }} }} | ||
| searchlabel = ... further results ({{ #expr: {{ #var: $query_count }} - {{ #var: $query_limit | 50 }} }} more) | | searchlabel = ... further results ({{ #expr: {{ #var: $query_count }} - {{ #var: $query_limit | 50 }} }} more) | ||
− | }} | + | }}<!-- |
debugging | debugging |
Revision as of 19:01, 3 June 2017
<ul><li>The part "{{{1}}}" of the query was not understood.Results might not be as expected.</li> <!--br--><li>Some subquery has no valid condition.</li></ul>
#ask
query:{{{1}}}
- $query_query:
{{{1}}}
- $query_query_lc:
{{{1}}}
- $query_medium:
- $query_medium_query:
- $query_query_medium:
- $query_card_type:
- $query_card_type_query:
- $query_col_card_type:
?Card type =
- $query_col_primary_type:
- $query_col_secondary_type:
- $query_col_attribute:
- $query_col_card_type_st:
?Card type = [[Card type]]
- $query_col_type:
- $query_col_stars:
- $query_col_scale:
- $query_col_atk:
- $query_col_def:
- $query_col_link_number:
- $query_col_property:
?Property = [[Property]]
{{{extra_column}}}
:{{{extra_label}}}
:- $query_col_extra:
- limit: 50
- $query_sort:
- $query_order:
- results count: 0<ul><li>The part "{{{1}}}" of the query was not understood.Results might not be as expected.</li> <!--br--><li>Some subquery has no valid condition.</li></ul>