0

YDN Spelling Suggestion Probelm

I believe this got to do with a either character encoding problem for example when i click on the example In

http://developer.yahoo.com/search/web/V1/s...Suggestion.html

url given in the help API page for spell checker is

Sample Request Url:
http://search.yahooapis.com/WebSearchServi...mp;query=madnna

This works perfectly in my browser too and returns the correct output as expected, BUT in my application when call

http://search.yahooapis.com/WebSearchServi...mp;query=maddna

THIS RETURNS incorrect malformed return

<ResultSet xsi:schemaLocation="urn:yahoo:srch http://api.search.yahoo.com/WebSearchServi...ot;/><!-- ws04.ydn.gq1.yahoo.com compressed/chunked Wed Apr 20 23:12:46 PDT 2011 -->

TWO URL exactly match each other and correctly executed

Any idea why ? my keyword is url encoded and website (www.sasrutha.com) is in UTF-8 so not sure wht the hell is going on ..!!!

any help is greatly appreciated

mahen

by
2 Replies
  • both of the following i have tried out bt none is working


    $yql_base_url = "http://query.yahooapis.com/v1/public/yql";
    $yql_query = 'SELECT * FROM search.spelling WHERE query="'.$keywords.'" AND appid="iw6UFLHV34HL0ljSwuA3SZKGlFlqDuOfqPyDG2uczZdqRIrnN94yxOZrHHePqg--" ';
    $yql_query_url = $yql_base_url . "?q=" . urlencode($yql_query);

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    //$yql_base_url = "http://query.yahooapis.com/v1/public/yql";
    $yql_base_url ="http://search.yahooapis.com/WebSearchService/V1/spellingSuggestion?appid=iw6UFLHV34HL0ljSwuA3SZKGlFlqDuOfqPyDG2uczZdqRIrnN94yxOZrHHePqg--&query=";
    $yql_query = $keywords;

    //echo $cur_encoding = mb_detect_encoding(utf8_encode ($keywords)) ; this comes up as ASCII

    $yql_query_url = "http://search.yahooapis.com/WebSearchService/V1/spellingSuggestion?appid=iw6UFLHV34HL0ljSwuA3SZKGlFlqDuOfqPyDG2uczZdqRIrnN94yxOZrHHePqg--&query=".urlencode($this->m_keywords)."";
    0
  • \got this one SOLVED sorry...
    0

Recent Posts

in General Discussion at YDN