Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 33268 invoked from network); 23 Nov 2004 14:00:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Nov 2004 14:00:53 -0000 Received: (qmail 27801 invoked by uid 500); 23 Nov 2004 14:00:51 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 27752 invoked by uid 500); 23 Nov 2004 14:00:50 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 27721 invoked by uid 99); 23 Nov 2004 14:00:50 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 23 Nov 2004 06:00:46 -0800 Received: (qmail 33140 invoked by uid 65534); 23 Nov 2004 14:00:45 -0000 Date: 23 Nov 2004 14:00:45 -0000 Message-ID: <20041123140045.33136.qmail@minotaur.apache.org> From: jeremy@apache.org To: cvs@cocoon.apache.org Subject: svn commit: r106299 - /cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js /cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml /cocoon/trunk/src/blocks/querybean/samples/screens/results.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: jeremy Date: Tue Nov 23 06:00:43 2004 New Revision: 106299 Modified: cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml cocoon/trunk/src/blocks/querybean/samples/screens/results.xml Log: adding Query Tips to querybean block Modified: cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js?view=diff&rev=106299&p1=cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js&r1=106298&p2=cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js&r2=106299 ============================================================================== --- cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js (original) +++ cocoon/trunk/src/blocks/querybean/samples/flow/QuerySearcher.js Tue Nov 23 06:00:43 2004 @@ -114,11 +114,26 @@ return new SimpleLuceneQueryBean(type, bool, match, field, ""); } - - - QuerySearcher.prototype.getTip = function(query) { - return null; + if (query.total > this._high) { + return ("query.tip.high"); + } else if (query.total < this._low) { + var allProhibited = true; + var criteria = query.getCriteria(); + for (var i = 0; i < criteria.size(); i++) { + if (!criteria.get(i).isProhibited()) { + allProhibited = false; + break; + } + } + if (allProhibited) { + return ("query.tip.prohibited"); + } else { + return ("query.tip.low"); + } + } else { + return null; + } } Modified: cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml?view=diff&rev=106299&p1=cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml&r1=106298&p2=cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml&r2=106299 ============================================================================== --- cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml (original) +++ cocoon/trunk/src/blocks/querybean/samples/i18n/messages_en.xml Tue Nov 23 06:00:43 2004 @@ -147,6 +147,32 @@ A simple query * required you cancelled your edit + + Query Tips + +

You can reduce the number of hits like this: +

    +
  • Try adding one or more criteria that match using "does not contain", to remove unwanted hits.
  • +
  • Try searching in specific fields instead of all fields.
  • +
  • Try requiring that all of your search criteria are matched, instead of just some of them.
  • +
  • Try increasing the number of required criteria.
  • +
  • Try using the match "contains the phrase" or "contains all words in".
  • +
+

+
+ +

You can increase the number of hits like this: +

    +
  • Try searching in all fields rather than a specific field.
  • +
  • Try matching your words using "is somthing like" or "contains any word in".
  • +
  • Try allowing the query to only match some of your criteria, instead of all of them.
  • +
  • Try increasing the number of non-required criteria.
  • +
+

+
+ +

All of your criteria are matched using "does not contain", this query will not work until you add at least one criterion that positively finds something, then the prohibiting criteria can filter hits from that one.

+
There was no query You have no history at the moment Modified: cocoon/trunk/src/blocks/querybean/samples/screens/results.xml Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/querybean/samples/screens/results.xml?view=diff&rev=106299&p1=cocoon/trunk/src/blocks/querybean/samples/screens/results.xml&r1=106298&p2=cocoon/trunk/src/blocks/querybean/samples/screens/results.xml&r2=106299 ============================================================================== --- cocoon/trunk/src/blocks/querybean/samples/screens/results.xml (original) +++ cocoon/trunk/src/blocks/querybean/samples/screens/results.xml Tue Nov 23 06:00:43 2004 @@ -52,9 +52,6 @@

- - ${result.tip} -

search.norecords.note

+ + <i18n:text i18n:catalogue="local">query.tip.title</i18n:text> + ${result.tip} +