Loading ...
Sorry, an error occurred while loading the content.

I only need search result counts, not the results themselves

Expand Messages
  • thinkloop
    Hello, The site I am working on uses the count of search results (i.e. 1.6 million hits for the term hello ) but not the results themselves. If I display 10
    Message 1 of 12 , Feb 11, 2010
    • 0 Attachment
      Hello,

      The site I am working on uses the count of search results (i.e. 1.6 million hits for the term "hello") but not the results themselves. If I display 10 records, I need to query the Yahoo service 10 times, once for each record, and throw away the majority of the data that comes back in the packet.

      I was wondering if there was a way to only get a count (without anything else), and more importantly, to be able to send batches of terms? For example, I could send the terms "hello", "world", "foo", and would get back a packet similar to:

      <query1>1,300,000</query1>
      <query2>567,000</query2>
      <query3>887,000</query3>

      Any ideas?

      Thanks a lot for a great service!

      Baz
    • BOSS User Group Support Team
      Hello Baz, Please see comments below... ... So luckily this is as simple as just specifying count=0 within your BOSS /web/ query, such as:
      Message 2 of 12 , Feb 12, 2010
      • 0 Attachment

        Hello Baz,

        Please see comments below...


        thinkloop wrote:
         

        Hello,

        The site I am working on uses the count of search results (i.e. 1.6 million hits for the term "hello") but not the results themselves. If I display 10 records, I need to query the Yahoo service 10 times, once for each record, and throw away the majority of the data that comes back in the packet.

        I was wondering if there was a way to only get a count (without anything else)



        So luckily this is as simple as just specifying "count=0" within your BOSS /web/ query, such as:

                http://boss.yahooapis.com/ysearch/web/v1/food?appid={YOUR APP ID HERE}&format=xml&count=0



        , and more importantly, to be able to send batches of terms?


        After performing some experiments, I'm fairly sure BOSS itself does not have this exact ability, as you clearly illustrate below.

        Therefore, you will have to make a separate BOSS /web/ API call, for each individual query term(s), instead of batching it up in a single BOSS API call.

        Or perhaps somebody else in this user group has a better solution.

        ---------------

        Hope this helps,
        Jay




        For example, I could send the terms "hello", "world", "foo", and would get back a packet similar to:

        <query1>1,300, 000</query1>
        <query2>567, 000</query2>
        <query3>887, 000</query3>

        Any ideas?

        Thanks a lot for a great service!

        Baz


      • Baz
        Thanks for the count=0 suggestion Jay, I have a feeling batch requests aren t possible either. Baz
        Message 3 of 12 , Feb 12, 2010
        • 0 Attachment
          Thanks for the count=0 suggestion Jay, I have a feeling batch requests aren't possible either.

          Baz

        • Ted Drake
          You can do batch processing in YQL. http://developer.yahoo.com/yql. I don t have the example in front of me, but I saw a demo where several requests were made
          Message 4 of 12 , Feb 12, 2010
          • 0 Attachment

            You can do batch processing in YQL. http://developer.yahoo.com/yql.

             I don’t have the example in front of me, but I saw a demo where several requests were made and the results were combined.

             

            You can also build an open table to something similar.

            Look at this example that does a boss search, then does an image search for each result and inserts the image into the original boss search results xml.

            http://developer.yahoo.com/yql/console/?q=use%20%27http%3A%2F%2Fyqlblog.net%2Fsamples%2Fsearch.imageweb.xml%27%20as%20searchimageweb%3B%20select%20*%20from%20searchimageweb%20where%20query%3D%27pizza%27%20%0A

             

             

            ted

             

            From: ysearchboss@yahoogroups.com [mailto:ysearchboss@yahoogroups.com] On Behalf Of Baz
            Sent: Friday, February 12, 2010 12:10 PM
            To: ysearchboss@yahoogroups.com
            Subject: Re: [ysearchboss] I only need search result counts, not the results themselves

             

             

            Thanks for the count=0 suggestion Jay, I have a feeling batch requests aren't possible either.

             

            Baz

             

          • Baz
            Woah! How cool is that! The console is fantastic too, I don t know how all of this slipped under my radar, thanks! If I get what I need done, I ll post my
            Message 5 of 12 , Feb 12, 2010
            • 0 Attachment
              Woah! How cool is that! The console is fantastic too, I don't know how all of this slipped under my radar, thanks! If I get what I need done, I'll post my query.

              Cheers,
              Baz

            • Ted Drake
              YQL uses boss, so you can do much of what you d do with plain boss. However, some of the parameters are slightly different. From: ysearchboss@yahoogroups.com
              Message 6 of 12 , Feb 12, 2010
              • 0 Attachment

                YQL uses boss, so you can do much of what you’d do with plain boss. However, some of the parameters are slightly different.

                 

                From: ysearchboss@yahoogroups.com [mailto:ysearchboss@yahoogroups.com] On Behalf Of Baz
                Sent: Friday, February 12, 2010 3:33 PM
                To: ysearchboss@yahoogroups.com
                Subject: Re: [ysearchboss] I only need search result counts, not the results themselves

                 

                 

                Woah! How cool is that! The console is fantastic too, I don't know how all of this slipped under my radar, thanks! If I get what I need done, I'll post my query.

                 

                Cheers,

                Baz

                 

              • Baz
                Hmm, when I use boss directly part of the packet I get back has totalhots: However using
                Message 7 of 12 , Feb 12, 2010
                • 0 Attachment
                  Hmm, when I use boss directly part of the packet I get back has totalhots:

                  <resultset_web count="0" start="0" totalhits="4803" deephits="4810">

                  However using YQL that data is missing :(

                  Any ideas?

                • drawdegnaw
                  This is awesome, I m 20 minutes into Yahoo API and I ve learned alot. A quick question though, searching for
                  Message 8 of 12 , Feb 12, 2010
                  • 0 Attachment
                    This is awesome, I'm 20 minutes into Yahoo API and I've learned alot.

                    A quick question though, searching for

                    http://boss.yahooapis.com/ysearch/web/v1/"I%20like%20yahoo"?appid=[app id]&format=xml&count=0

                    returns totalhits="23267" deephits="24400"
                    but on http://search.yahoo.com/search?p=%22i+like+yahoo%22&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701

                    returns 80,000 hits.

                    Also, whats the best way to return totalhits to a php variable?

                    Thanks in advance.

                    -Edward

                    --- In ysearchboss@yahoogroups.com, BOSS User Group Support Team <boss-usergroup-support-team@...> wrote:
                    >
                    >
                    > Hello Baz,
                    >
                    > Please see comments below...
                    >
                    >
                    > thinkloop wrote:
                    > >
                    > >
                    > > Hello,
                    > >
                    > > The site I am working on uses the count of search results (i.e. 1.6
                    > > million hits for the term "hello") but not the results themselves. If
                    > > I display 10 records, I need to query the Yahoo service 10 times, once
                    > > for each record, and throw away the majority of the data that comes
                    > > back in the packet.
                    > >
                    > > I was wondering if there was a way to only get a count (without
                    > > anything else)
                    > >
                    >
                    >
                    > So luckily this is as simple as just specifying "count=0" within your
                    > BOSS /web/ query, such as:
                    >
                    > http://boss.yahooapis.com/ysearch/web/v1/food?appid={YOUR APP ID
                    > HERE}&format=xml&count=0
                    >
                    >
                    >
                    > > , and more importantly, to be able to send batches of terms?
                    > >
                    >
                    > After performing some experiments, I'm fairly sure BOSS itself does not
                    > have this exact ability, as you clearly illustrate below.
                    >
                    > Therefore, you will have to make a separate BOSS /web/ API call, for
                    > each individual query term(s), instead of batching it up in a single
                    > BOSS API call.
                    >
                    > Or perhaps somebody else in this user group has a better solution.
                    >
                    > ---------------
                    >
                    > Hope this helps,
                    > Jay
                    >
                    >
                    >
                    >
                    > > For example, I could send the terms "hello", "world", "foo", and would
                    > > get back a packet similar to:
                    > >
                    > > <query1>1,300,000</query1>
                    > > <query2>567,000</query2>
                    > > <query3>887,000</query3>
                    > >
                    > > Any ideas?
                    > >
                    > > Thanks a lot for a great service!
                    > >
                    > > Baz
                    > >
                    > >
                    >
                  • balancedsearch
                    I prefer to get results in json format, just because of the ease you ask about. Note the format variable in the BOSS request URL for test :
                    Message 9 of 12 , Feb 15, 2010
                    • 0 Attachment
                      I prefer to get results in json format, just because of the ease you ask about. Note the "format" variable in the BOSS request URL for "test":

                      http://boss.yahooapis.com/ysearch/web/v1/test?appid=.....&format=json&sites=&count=10&start=0&lang=en®ion=us

                      The result that comes back from your CURL can be decoded with a simple json_decode.

                      $new_php_array = json_decode ( $curl_response , true );

                      If you do a var_dump, you can see the whole format.

                      Party on, Wayne.


                      --- In ysearchboss@yahoogroups.com, "drawdegnaw" <drawdegnaw@...> wrote:
                      .
                      .
                      .
                      >
                      > Also, whats the best way to return totalhits to a php variable?
                      >
                      > Thanks in advance.
                      >
                      > -Edward
                      >
                      .
                      .
                      .
                    • Rabia
                      Hi, Currently, that is not supported with BOSS. http://developer.yahoo.net/forum/index.php?showtopic=826&hl=count However, one can collect that information
                      Message 10 of 12 , Feb 15, 2010
                      • 0 Attachment
                        Hi,

                        Currently, that is not supported with BOSS.

                        http://developer.yahoo.net/forum/index.php?showtopic=826&hl=count

                        However, one can collect that information with YQL and Microsoft Bing. When I tried the following query with YQL it returned 12700000 for sushi and 132000000 for apple.

                        SELECT * FROM microsoft.bing(0) WHERE query in ("sushi","apple") AND source="web",

                        I wish we could do the same thing with BOSS :(.

                        Rabia



                        --- In ysearchboss@yahoogroups.com, Baz <lists@...> wrote:
                        >
                        > Hmm, when I use boss directly part of the packet I get back has totalhots:
                        >
                        > <resultset_web count="0" start="0" totalhits="4803" deephits="4810">
                        >
                        > However using YQL that data is missing :(
                        >
                        > Any ideas?
                        >
                      • Baz
                        Thanks for the suggestion, but I get: No definition found for Table query.multi Any ideas?
                        Message 11 of 12 , Feb 15, 2010
                        • 0 Attachment
                          Thanks for the suggestion, but I get:

                          
                          No definition found for Table query.multi
                          
                          
                          
                          Any ideas?
                        • Nookie1
                          Message 12 of 12 , Mar 29, 2010
                          • 0 Attachment
                            --- In ysearchboss@yahoogroups.com, "drawdegnaw" <drawdegnaw@...> wrote:
                            >
                            > This is awesome, I'm 20 minutes into Yahoo API and I've learned alot.
                            >
                            > A quick question though, searching for
                            >
                            > http://boss.yahooapis.com/ysearch/web/v1/"I%20like%20yahoo"?appid=[app id]&format=xml&count=0
                            >
                            > returns totalhits="23267" deephits="24400"
                            > but on http://search.yahoo.com/search?p=%22i+like+yahoo%22&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701
                            >
                            > returns 80,000 hits.
                            >
                            > Also, whats the best way to return totalhits to a php variable?
                            >
                            > Thanks in advance.
                            >
                            > -Edward
                            >
                            > --- In ysearchboss@yahoogroups.com, BOSS User Group Support Team <boss-usergroup-support-team@> wrote:
                            > >
                            > >
                            > > Hello Baz,
                            > >
                            > > Please see comments below...
                            > >
                            > >
                            > > thinkloop wrote:
                            > > >
                            > > >
                            > > > Hello,
                            > > >
                            > > > The site I am working on uses the count of search results (i.e. 1.6
                            > > > million hits for the term "hello") but not the results themselves. If
                            > > > I display 10 records, I need to query the Yahoo service 10 times, once
                            > > > for each record, and throw away the majority of the data that comes
                            > > > back in the packet.
                            > > >
                            > > > I was wondering if there was a way to only get a count (without
                            > > > anything else)
                            > > >
                            > >
                            > >
                            > > So luckily this is as simple as just specifying "count=0" within your
                            > > BOSS /web/ query, such as:
                            > >
                            > > http://boss.yahooapis.com/ysearch/web/v1/food?appid={YOUR APP ID
                            > > HERE}&format=xml&count=0
                            > >
                            > >
                            > >
                            > > > , and more importantly, to be able to send batches of terms?
                            > > >
                            > >
                            > > After performing some experiments, I'm fairly sure BOSS itself does not
                            > > have this exact ability, as you clearly illustrate below.
                            > >
                            > > Therefore, you will have to make a separate BOSS /web/ API call, for
                            > > each individual query term(s), instead of batching it up in a single
                            > > BOSS API call.
                            > >
                            > > Or perhaps somebody else in this user group has a better solution.
                            > >
                            > > ---------------
                            > >
                            > > Hope this helps,
                            > > Jay
                            > >
                            > >
                            > >
                            > >
                            > > > For example, I could send the terms "hello", "world", "foo", and would
                            > > > get back a packet similar to:
                            > > >
                            > > > <query1>1,300,000</query1>
                            > > > <query2>567,000</query2>
                            > > > <query3>887,000</query3>
                            > > >
                            > > > Any ideas?
                            > > >
                            > > > Thanks a lot for a great service!
                            > > >
                            > > > Baz
                            > > >
                            > > >
                            > >
                            >
                          Your message has been successfully submitted and would be delivered to recipients shortly.