This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Triggering a search by url with additional term filters

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Triggering a search by url with additional term filters

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #18774
    DavidHDavidH
    Participant

    Hi,

    I’m wondering if it’s possible to trigger a search by url as described here: https://wp-dreams.com/knowledge-base/trigger-search-via-an-url/
    But… add category/terms parameters to that search so something like:

    https://www.allen-heath.com/document-library/?asp_id=1&asp_s=technical datasheet&att-tag-term=dlive

    I saw in a discussion on Envato a year ago, that you agreed this would be a good feature request but I’m guessing you havent implemented it so far.

    Would love to hear if you plan to make any progress with that.
    Thanks for a fantastic plugin by the way! It’s amazing!
    All the best
    David

    #18776
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi David,

    Thank you very much for your kind words!

    For the custom field filters it is now possible, the taxonomy term part is not ready yet. However there is an API call, that can give you the ‘state URL’ of the current search, which is basically what you are looking for. The downside of this is, that it cannot be easily modified as it is base64 encoded. This state URL can be requested via the javascript console.

    To get a URL to a specific search state, do the following:
    1. Set up the search filters as you need them. In this example I have selected the following filters: https://i.imgur.com/914TuSP.png

    2. Open your developer console. In Google Chrome browsers you need to hit the F12 button once, and a window will open on the bottom of the browser window. Make sure to navigate to the ‘console’ tab there, it should look like this: https://i.imgur.com/H9a2hGW.png

    3. Now, enter the following code to the console input:

    [code]ASP.api(1, 1, ‘getStateURL’);[/code]

    ..and then hit the enter key to execute it. It should return something like this: https://i.imgur.com/W72RSQA.png

    4. That is the state URL of the current search filters and input. You can right click to copy it. Using that URL will open the same exact page with these exact filters selected.
    In my case this URL was exactly this.

    You can use this method to generate any states, then copy the URLs. If you visit these URLs the search is re-created with the filters and the search phrase chosen.

    I hope this helps 🙂

    #18777
    DavidHDavidH
    Participant

    Ernest. You are a legend! That worked perfectly!

    Thank you so much!

    I’m getting a “More Results (9)” and I’m not sure why though… I’ll probably figure that out… seem to only get 10 results listed with the URL search.
    Hmmmm…

    Thanks
    David

    #18778
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #18782
    DavidHDavidH
    Participant

    Hi Ernest,

    Sorry more questions regarding this. Using this method I only get 10 results returned and clicking on “More Results (9)” isnt working.
    I’m wondering if there’s a wordpress filter somewhere that’s limiting the results but I cant find it.

    https://www.allen-heath.com/document-library/?p_asid=1&p_asp_data=Y3VycmVudF9wYWdlX2lkPTc2NjA3JnF0cmFuc2xhdGVfbGFuZz0wJmFzcF9nZW4lNUIlNUQ9Y29udGVudCZ0ZXJtc2V0JTVCYXR0YWNobWVudF90YWclNUQlNUIlNUQ9MjgzJnRlcm1zZXQlNUJjYXRlZ29yeSU1RCU1QiU1RD0yNjY=

    Any thoughts?

    Thanks
    David

    • This reply was modified 7 years, 10 months ago by DavidHDavidH.
    #18789
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi David,

    That might possibly be a minor bug due to the difference of number of results between the auto-populate and the regular results limit.

    Can you please try changing the auto-populate results limit to the same number as the regular results limit:
    – auto-populate limit: https://i.imgur.com/9gQ7Nay.png
    – results limit: https://i.imgur.com/E1hXcwN.png
    I think if you set both of these to the same number, then the ‘more results’ link should start working as well.

    #18790
    DavidHDavidH
    Participant

    You hero!! Set both of those to 100 and now working perfectly!

    Off to rate the plugin 5 stars on codecanyon.

    Thank you so much!

    David

    #18791
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #18792
    DavidHDavidH
    Participant

    Yep. Close it. I’ve got it working just how I need it now. Thank you again Ernest 🙂

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Triggering a search by url with additional term filters’ is closed to new replies.