One item won't index and show up in search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support One item won't index and show up in search

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 1 month, 2 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #39982
    Mark Frankel
    Mark Frankel
    Participant

    We added a new product and cannot get it to show up in the search. We’ve tried reindexing multiple times and checked the input of the product but no luck.

    It does have a special character, so we tried to remove and reindex and no luck.

    This is the product https://www.omseating.com/series/lorien-collection/

    No error messages and doesn’t change when the theme is changed.

    #39989
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much for the details!

    I checked your configuration and everything seemed to be setup correctly. The page did not show up in the search results page, because the search override was not triggered. It happens sometimes with custom made results pages or in cases where a custom code is used instead of the actual search query, or the query is altered in a different way.

    Anyways, I have enabled this option to make the override more aggressive, now the results page should contain more results.

    I strongly recommend using the default query to fetch the posts on the results page following the WordPress theme coding guidelines, otherwise some unwanted results may appear. Custom made results pages are usually built for specific queries and ignore the original, and an “override” may add items to those queries, which are unwanted.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #39991
    Mark Frankel
    Mark Frankel
    Participant

    Thank you, Ernest! Much appreciated.

    #39992
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #40222
    Mark Frankel
    Mark Frankel
    Participant

    Hello-

    Unfortunately the change taht was made rolled through all of our serach results and we had to revert. this from my programmer:

    “I checked the search issue, and the change made messed up the search results page.
    We’re getting a page with a broken layout, and unorganized search results, where options come up under series, and series come up under fabrics, etc.

    I’ve turned off the option/change they made, and everything is back to normal again.

    What they’re saying doesn’t make sense to me- why would our setting and custom code work for all other product keywords and searches, except for “Lorien” keyword.

    We always get the expect search results. The only time we don’t get any results at all is for the “Lorien” keyword.

    Can you please forward this message to them and see what they say.”

    Please let us know your thoughts.

    Many thanks!
    Mark

    #40250
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I understand, thank you.

    Unfortuantely I was right – the search results page is using multiple sub-queries, I just checked the results page source. I guess this is for organization purposes or so.
    However this creates the massive issue. The search results should always originate from the original WordPress search query, not from custom queries, that is a bad practice. The reason behind it is, that search plugins can hardly determine which queries to overtake, and they expect a single query for the results. This is because the pagination, the number of results and many other variables.
    Currently what happens is, that multiple search queries being executed within the actual search loop. When the soft-check option is active, the plugin tries to overtake on these queries as well, which is the source of the problem.
    If you can’t avoid using these subqueries, then my suggestion is to change these queries to non-search queries instead – that may actually work without conflict. For the arguments the “post_type” and the “post__in” from the current page without the “s” arguments.

    global $wp_query;
    $post_ids = wp_list_pluck( $wp_query->posts, 'ID' );
    $args = array(
    	'post_type'=> 'post_type',
    	'post__in' = $post_ids,
    	'showposts' => -1
    );
    // Custom query.
    $query = new WP_Query($args);
    // Check that we have query results.
    if ( $query->have_posts() ) {
        // Start looping over the query results.
        while ( $query->have_posts() ) {
            $query->the_post();
            // Contents of the queried post results go here.
        }
     
    }
    // Restore original post data.
    wp_reset_postdata();

    Something like this, but it should not be too difficult, your programmer can very likely figure it out. I could not see the wp_reset_postdata() call inbetween the queries, which is also very important to maintain the proper structure. This may needs a bit of experimenting, but I am already a bit out of the plugin support boundaries, but I hope this helps anyways.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #40528
    Mark Frankel
    Mark Frankel
    Participant

    Hi Ernest-

    Thank you for your last email. It helped us to figure out what was going on and get things working correctly. It’s very much appreciated and we are grateful you were willing to advise outside of the normal plugin support.

    Thank you again and happy holidays!

    Mark

    #40530
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Mark,

    You are very welcome. It is great to hear you were able to resolve this, I was more than happy to help you 🙂 I wish you happy holidays too!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.