From 8f4fd271de4edbf1a206dfa0a98f8276f6189709 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Thu, 29 Mar 2012 19:56:41 +0200 Subject: Bug 554819: Quicksearch should be using Text::ParseWords instead of custom code in splitString Also fixes QS with accented characters (bug 730207) r=dkl a=LpSolit --- template/en/default/global/user-error.html.tmpl | 21 +++++++ template/en/default/pages/quicksearch.html.tmpl | 83 ++++++++++++++++++++++--- 2 files changed, 96 insertions(+), 8 deletions(-) (limited to 'template') diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index feff9f042..3d1ac5c53 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1448,6 +1448,27 @@ The name of the query must be less than [% constants.MAX_LEN_QUERY_NAME FILTER html %] characters long. + [% ELSIF error == "quicksearch_invalid_query" %] + [% title = "Invalid Query" %] + Your query is invalid. + [% IF operators %] + The [% operators.shift FILTER html %] operator cannot be followed by + [%+ operators.shift FILTER html %]. + [% ELSE %] + A query cannot start with AND or OR, nor can it end with AND, OR or NOT. + They are reserved operators and must be quoted if you want to look for + these strings. + [% END %] + + [% ELSIF error == "quicksearch_unbalanced_quotes" %] + [% title = "Badly Formatted Query" %] + [% terms.Bugzilla %] is unable to parse your query correctly: + [% string FILTER html %].
+ If you use quotes to enclose strings, make sure both quotes are present. + If you really want to look for a quote in a string, type \" instead of ". + For instance, "I'm so \"special\", really" (with quotes) will be + interpreted as I'm so "special", really. + [% ELSIF error == "quicksearch_unknown_field" %] [% title = "QuickSearch Error" %] There is a problem with your search: diff --git a/template/en/default/pages/quicksearch.html.tmpl b/template/en/default/pages/quicksearch.html.tmpl index e6398eade..901f05467 100644 --- a/template/en/default/pages/quicksearch.html.tmpl +++ b/template/en/default/pages/quicksearch.html.tmpl @@ -38,7 +38,16 @@ -

The Basics

+ + +

The Basics

-

You may also want to read up on the Advanced - Features.

+

Examples of Simple Queries

+ +

Here are some examples of how to write some simple queries. + Examples for more complex queries can be + found lower in this page.

+ +

Fields You Can Search On

@@ -143,15 +176,18 @@ -

Advanced Features

+

Advanced Features

+

You cannot use | nor OR to enumerate possible values for a given field. + You must use commas instead. So field:value1,value2 does what + you expect, but field:value1|value2 would be treated as + field:value1 OR value2, which means value2 is not bound to + the given field.

+

OR has higher precedence than AND; AND is the top level operation. For example:

Searching for url|location bar|field -focus means @@ -271,4 +313,29 @@ +

Examples of Complex Queries

+ +

It is pretty easy to write rather complex queries without too much effort. + For very complex queries, you have to use the + Advanced Search form.

+ + + [% PROCESS global/footer.html.tmpl %] -- cgit v1.2.3-24-g4f1b