• Resolved pixelguy

    (@pixelguy)


    Hi,

    I get an 400 (Bad Request) on the API Call. The problem seems to originate in the plugin file here:

    https://example.com/wp-content/plugins/wp-search-with-algolia/js/algoliasearch/dist/algoliasearch-lite.umd.js?ver=2.4.0

    The message is:

    {"message":"indexName is not valid","status":400}

    But the index name is valid and it works on other sites of the page?!

    The plugin tries to open the following link (ID and KEY changed):

    https://APPLICATIONID-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20JavaScript%20(4.14.2)%3B%20Browser%20(lite)%3B%20instantsearch.js%20(4.49.1)%3B%20JS%20Helper%20(3.11.1)&x-algolia-api-key=APIKEY&x-algolia-application-id=APPLICATIONID

    I’m using the last plugin version 2.4.0.

    Any ideas?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    What’s the index name in question in this case? Have you done any customizations around the plugin in regards to indexing processes?

    Thread Starter pixelguy

    (@pixelguy)

    The name of the index is wp_woocommerce_live

    We’re using the same index for other parts of the site and it works fine.
    And the problem is new. The same integration/function worked a few days ago (not sure how many)

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    hmm. Typically the indexes that are generated from WP Search with Algolia, are $prefix_searchable_posts and then $prefix_posts_$post_type naming structure. In your case it looks like $prefix_ is still the default wp_ value. However, without doing some filtering, we wouldn’t end up with a woocommerce_live suffix. I definitely understand if this is an already in-use index created before beginning integration with WP Search with Algolia, and I’m pretty sure we can get it included in with the plugin as well, just need to do some filtering.

    Does this all sound like how things have gone thus far for your install?

    Thread Starter pixelguy

    (@pixelguy)

    Sorry, the index should end with _products

    This is the code for the indexName: indexName: algolia.indices.posts_product.name

    It works on category pages with the same function and indexName

    Thread Starter pixelguy

    (@pixelguy)

    Is the URL complete like this? I don’t see an index name:

    https://APPLICATIONID-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20JavaScript%20(4.14.2)%3B%20Browser%20(lite)%3B%20instantsearch.js%20(4.49.1)%3B%20JS%20Helper%20(3.11.1)&x-algolia-api-key=APIKEY&x-algolia-application-id=APPLICATIONID

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Given the indexName detail, it sounds like you’ve been customizing your instantsearch.php template file, correct?

    The indexName spot in the default template looks like this:

    indexName: algolia.indices.searchable_posts.name

    Also is this search page on a publicly accessible URL? or is it all local/private dev at the moment?

    Thread Starter pixelguy

    (@pixelguy)

    Given the?indexName?detail, it sounds like you’ve been customizing your instantsearch.php template file, correct?

    Yes, it’s customized

    Also is this search page on a publicly accessible URL??

    Yes, it’s publicly accessible

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Can you share the link with us? I’d like to see what I can infer from what’s available there.

    Thread Starter pixelguy

    (@pixelguy)

    Can I send you a link in private?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You can reach us with the form at https://pluginize.com/contact/ and I’ll be able to reach the message there.

    Please include this link so that I know which support thread the created ticket relates to https://www.ads-software.com/support/topic/400-bad-request-on-api-call/

    Thanks.

    Thread Starter pixelguy

    (@pixelguy)

    done ??

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Responded privately

    Thread Starter pixelguy

    (@pixelguy)

    Great support, thank you!

    • This reply was modified 1 year, 11 months ago by pixelguy.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Issue was related to instantsearch configure widget and empty parameters in a filter

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘400 (Bad Request) on API Call’ is closed to new replies.