Forum Moderators: open

Message Too Old, No Replies

can i ask a newbie question regarding using yahoowebsearch api

how to get exact hit counts on a query, and query limit questions

         

jhs2zz

11:22 am on Jan 24, 2007 (gmt 0)

10+ Year Member



Hi, I want the program to return the hit counts on a query. However, the results-per-query limits the hit counts, I wonder if i have done it wrong? can you hint me if i am doing this correctly: (java code)

++++++++++++++++++++++++++++++

SearchClient searchClient = new SearchClient("somekey");

WebSearchRequest request = new WebSearchRequest("try this query");
request.setResults(getResultsPerQuery); //LINE
3 "getResultsPerQuery" isa a local method reads xml configurations

WebSearchResults wsr = searchClient.webSearch(request);
WebSearchResult[] resultList = wsr.listResults();

System.out.println(resultList.size());

+++++++++++++++++++++++++++++++

the problem is, LINE 3 limits results to be returned by each query.
if the xml says its "50", then even there are 1000 results, the
request returns "50". Should i remove that line to get unlimited and
thus "actual" result counts?

also, what exactly does "results-per-query" and "max-results-per-
query" mean? if i set

results-per-query=50,

and i download all these 50 results returned, does it cost 50
queries? Im asking because there are only 5000 queries available a
day per IP. And I wonder if "results-per-query" and "max-results-per-
query" have any impact on this 5000 quota?

Thank you!