locked
no SearchResponse InstantAnswer results RRS feed

  • Question

  • I'm trying to test the Instant Answer results in the Live Search API 2.0, but it's not returning anything.

    Search on live.com for "university of washington huskies" returns an Instant Answer:
    http://search.live.com/results.aspx?q=university+of+washington+huskies&form=QBRE&custom=1&checkcustom=1

    In my C# code, I have a valid API and I'm using the MultipleSourceTypesSample and included
    InstantAnswer as well.
    request.Sources = new SourceType[]
    {
      SourceType.Web,
      SourceType.RelatedSearch,
      SourceType.InstantAnswer
    };

    This is partial code in the "DisplayResponse(SearchResponse response)" method:
    System.Text.StringBuilder builder = new System.Text.StringBuilder();
    foreach (InstantAnswerResult result in response.InstantAnswer.Results) // errored here
    {
      builder.Length = 0;
      builder.AppendLine(result.Title);
      builder.AppendLine(result.Url);
      builder.AppendLine(result.InstantAnswerSpecificData);
      DisplayTextWithHighlighting(builder.ToString());
      Console.WriteLine();
    }

    It returns the
    SourceType.Web and SourceType.RelatedSearch results, but not SourceType.InstantAnswer .  On response.InstantAnswer.Results , I get the error "Object reference not set to an instance of an object.".

    Is this a bug, or should I look at a different way of returning results for Instant Answers?

    Tuesday, December 16, 2008 3:02 AM

Answers

  • Instant answers are an umbrella type that has several subcategories.

     

    If you type "university of washington huskies" in Live.Com you get an answer of type "sport answer".

     

    Unfortunately, for the time being, only the reference answers (like "population of China" or "X^2+2x+1=0" or "calories in a boar") are supported publicly in the API.

     

    We are working to extend the support to many more answers in the future.

     

    HTH

     

    --Alessandro

     

     

     

    Wednesday, December 17, 2008 3:20 AM