Join Free
  • Inbox
    + Reply to Thread
    Results 1 to 6 of 6
    1. #1

      Multi query operations

      Hi,

      It seems that I can’t call a multi query operation (OR operation) with Trends API. I tried:

      Code:
      query: laptop bags | laptop case
      query: @keyword laptop bags | laptop case
      query: array(‘laptop bags’, ‘laptop case’)
      extendedQuery: laptop bags | laptop case
      extendedQuery: @keyword laptop bags | laptop case
      filterKeyword: laptop bags | laptop case
      filterKeyword: array(‘laptop bags’, ‘laptop case’)
      but none of the settings above achieve an OR operation for ‘laptop bags’ OR ‘laptop case’.

      Code:
      query: laptop bags | laptop case
      returned a result. Though it seems it was a right method to do an OR operation, but it wasn’t. The result was not an OR operation for ‘laptop bags’ result OR ‘laptop case’ result. If I add an empty result query in it, eg:
      Code:
      query: laptop bags | laptop case | asdfjkasdf
      it will return an empty result.

      What is the method / parameter to set a multi query operation (OR operation) within Trends API (API Ver. 2.0.8)?

      Thanks

    2. #2
      Administrator Prosperent Andrew's Avatar
      Join Date
      Apr 2011
      Location
      Colorado Springs, CO
      Posts
      246
      Try:

      Code:
          $prosperentApi = new Prosperent_Api(array(
              'commissionDateRange' => '20120301,20120501',
              'filterKeyword' => array('*laptop bag*', '*laptop case*')
          ));
      
          $prosperentApi->fetchTrends();
      The * provides a loose match, instead of an exact match. To hit on an exact match, you would need to know the entire keyword you are looking for, ie. 'filterKeyword' => 'HEX 11 Recon Laptop Case'

      See thread on wildcard filtering: http://community.prosperent.com/show...highlight=nike

    3. #3
      Thanks Andrew,

      It works perfectly, accept for one thing: I’m not able to insert a wildcard between words.

      query: laptop bags -> returned 7 results.
      filterKeyword: array(‘*laptop bags*’) -> returned empty result.
      filterKeyword: array(‘*laptop*bags*’) -> returned empty result.

      Is there a way to insert wildcard between words? Or other way to achieve multi query operation?

    4. #4
      For that, you would basically have to use an or between the words you want separated.

    5. #5
      Quote Originally Posted by edwin32 View Post
      Thanks Andrew,

      It works perfectly, accept for one thing: I’m not able to insert a wildcard between words.

      query: laptop bags -> returned 7 results.
      filterKeyword: array(‘*laptop bags*’) -> returned empty result.
      filterKeyword: array(‘*laptop*bags*’) -> returned empty result.

      Is there a way to insert wildcard between words? Or other way to achieve multi query operation?
      Also remember that this isn't the catalog. Depending on your date range, I would only expect a few results for a very specific product like laptop bags. They may not be very popular items.

    6. #6
      Thanks Brian,

      Because this is not the catalog, I think it would be better to get all the data without filter and process it locally, rather than cache individual query results which can contain thousands of queries. Thanks for your input.

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts