• Resolved odork123

    (@odork123)


    Hi, i’d like to get the post datas only from the solr index. Almost everything works fine, my index is perfect and there are results in the WPSOLR_Query, but i got stuck :S

    In the wpsolr-abstract-search-client.php’s get_posts_from_pids() function the $this->results parameter is not ok.

    ORIGINAL CODE:

    // Create pseudo posts from Solr results
    $results = [ 'posts' => [], 'documents' => [] ];
    foreach ( $this->results as $document ) {
    ...

    SHOULD BE:

    // Create pseudo posts from Solr results
    $results = [ 'posts' => [], 'documents' => [] ];
    foreach ( $this->results->get_results() as $document ) {
    ...

    Ater this i would use the WpSolrFilters::WPSOLR_ACTION_POSTS_RESULTS action’s two parameter to fill the empty posts with data – almost empty: ID is isset (xyblogname_xyid). Or instead of this should i just use the WpSolrFilters::WPSOLR_ACTION_POSTS_RESULTS?

    If i use the WpSolrFilters::WPSOLR_ACTION_POSTS_RESULTS action, the is_galaxy_master logic seems to be unnecessary.

    I think something is missing here, maybe this “Create pseudo posts from Solr results” part of the code should be improved (+some filter / action to build the post with the data we received).

    Or did i miss something?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WPSolr free

    (@wpsolr)

    Hi,

    The code on the latest version is:

    $posts_ids = [];
    foreach ( $this->results->get_results() as $document ) {

    You must be using a deprecated version.

    I do not understand what you indend to do with:

    i’d like to get the post datas only from the solr index

    Thread Starter odork123

    (@odork123)

    I have checked the latest version both of the free & pro plugin and the wpsolr-abstract-search-client.php’s line 1687. contains this:

    foreach ( $this->results as $document ) {

    I ‘d like to pass the indexed post data and indexed postmetas into the loop / wp_query / wp_cache for native use without querying the database, so now i’m searching for the best, most optimal way to do that.

    Plugin Author WPSolr free

    (@wpsolr)

    I understand you want to get the Solarium results, to extract it’s data without calling the database.

    Here a possibility:
    The results filter also gives you the Solarium results (2nd parameter). You can dig in to retrieve what you need.

    If you need more data coming from Solr, you can adjust the query first, with the query filter.

    Thread Starter odork123

    (@odork123)

    Thank you! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘“Galaxy master” results’ is closed to new replies.