Raghuveersingh / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 0 forks source link

FILTERED_CSE_RESULTSET unexpected behavior #382

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Summary:

In the test cases, FILTERED_CSE_RESULTSET fails to enforce its intended
restriction.

____________________________________________________________

Steps to reproduce:

Preparation:
Create a test CSE by following the procedure described under "Suggested CSE
configuration for tests" below.  This will be a 'Boost' CSE with no
specified ranking bias.

Test case 1:
Create a WebSearch instance, and call setSiteRestriction with the ID of the
test CSE.  Add the searcher to a Search Control.  AFTER adding the searcher
to the control, call setResultSetSize on either the searcher or the
control, with google.search.Search.FILTERED_CSE_RESULTSET.

Test case 2:
Create a Custom Search Control instance, passing the test CSE ID to the
constructor.  (The CSC constructor of course adds a WebSearch searcher,
with restriction to the specified CSE.)  Call setResultSetSize on the
control, with google.search.Search.FILTERED_CSE_RESULTSET.

____________________________________________________________

Expectations vs. observed behavior:

Expectations:
API documentation states that FILTERED_CSE_RESULTSET will (as its name
indicates) "only work for Web Search queries scoped to a Filter Custom
Search engine, otherwise an error will be returned." ... Therefore for
WebSearch scoped to a 'Boost' CSE, FILTERED_CSE_RESULTSET would be expected
to fail and produce an error.

Observed behavior:
Contrary to documentation, in the test cases setResultSetSize with
FILTERED_CSE_RESULTSET (called AFTER adding the searcher to a control) will
succeed, and queries will produce 10 results per page and up to 100 total
API results, from a CSE configured for unfiltered web search.

____________________________________________________________

Versions:

AJAX Search API 1.0.

(Test client details are irrelevant in this case.)

____________________________________________________________

CSE background information:

'Filter' CSEs search specified sites exclusively.  'Boost' CSEs search
without exclusive filtering, but with a ranking bias for individual sites
specified, if any.  The suggested test configuration is a 'Boost' CSE with
no specified site bias.

____________________________________________________________

Suggested CSE configuration for tests:

To create the test CSE, start here:
http://www.google.com/cse/manage/create?hl=en

Enter whatever name and description (required).  Under "What do you want to
search?", click: "The entire web, but emphasize sites I select."

In "Sites to search", specify any one site (e.g. google.com).  (This step
requires that a site be specified, but in the last step below you'll remove
it from the CSE.)

Agree to terms, click "Next", click "Finish".  You reach the "My search
engines" page:
http://www.google.com/cse/manage/all?hl=en

Click the "control panel" link.  On the "Control panel - Basics" page note
the "Search engine unique ID", which will be passed to setSiteRestriction
(for test case 1) or the CSC constructor (for test case 2).

Click "Sites" (left column).  Check-mark the entry for the site that you
previously specified.  Click "Delete".  The list of included sites is now
empty so you are not specifying any ranking bias.

Ranking bias has no real effect on test conclusions, but with the bias
removed the tests immediately demonstrate 10*10 results from an obviously
unfiltered variety of sites.

We conclude that FILTERED_CSE_RESULTSET fails to enforce its intended
restriction.

Original issue reported on code.google.com by omr99...@yahoo.com on 19 Jan 2010 at 8:20

GoogleCodeExporter commented 9 years ago

Original comment by jscud.w...@gmail.com on 26 Jan 2010 at 6:22