Custom Queries from wpsolr Pro

  • 2 years, 4 months ago #30188

    We would like to know is there any way to build custom queries to get data from solr server using wpsolr pro plugin. Could you help us on that.

    Note: Requirement is like to show the related articles in every single page.

    wpsolr
    Keymaster
    2 years, 4 months ago #30191

    WPSOLR cannot currently manage “More like this” queries, because it can only replace the main query from the archives.

    And WPSOLR has no public API neither (difficult to build a common API wrapping Elasticsearch, OpenSearch, Solr, Algolia, Weaviate): using the current WPSOLR internal code to build something custom would be risky to be broken in later releases.

    You can of course build something outside of WPSOLR, like calling the JSON Solr More like this API, and let WPSOLR manage the heavy stuff (indexing for instance). This looks the best way on the short term.

    2 years, 4 months ago #30194

    Thanks for the Response. Can we get a sample API to get data like sample request and response.

    wpsolr
    Keymaster
    2 years, 4 months ago #30196

    I have no clue, as it is a completely new feature.

    2 years, 4 months ago #30198

    Is that Possible to include the wpsolr pro plugin files into the child theme template?

    wpsolr
    Keymaster
    2 years, 4 months ago #30199

    It would be risky, as the plugin’s code is not a public API, and can therefore change in the next releases.

    The only code which can be used are the WPSOLR hooks. But they are not meant to manage “More like this features”, so not useful.

    wpsolr
    Keymaster
    2 years, 4 months ago #30212
Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.