Searching page contents

This topic contains 6 replies, has 2 voices, and was last updated by tedl00 tedl00 1 year ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #41875
    tedl00
    tedl00
    Participant

    Ajax Search Pro does not seem to be searching the content of pages. After installation I can successfully search post titles and content as well as page titles. If I search for words that are only found in the content of the page I get a nothing found message. Is this normal? Is there some setting the I am missing?

    —ted

    #41888
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Ted,

    That is definitely not normal, the plugin does search the page contents by default. Make sure that the search in the content fields is enabled.

    If the page contents are dynamically generated or outputted via shortcodes, custom codes or anything similar, then you may want to consider using the index table engine.
    In those cases the page contents are not actually stored in the posts database, therefore they are not searchable. The index table engine will collect the processed page contents for the output and index it’s contents for searching.

    Best,
    Ernest Marcinko

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


    #41894
    tedl00
    tedl00
    Participant

    Hi Ernest,
    Thanks for getting back to me. The index table engine did not solve the problem. After much Google searching I discovered that Oxygen Builder was causing the problem. Oxygen-built pages put the info in a custom field. Once I added the custom field ct_builder_shortcodes the search results for pages began to appear. Yeah.

    One remaining issue though. I like using the feature where the search results show the keyword in context of the page/post contents. This works fine for posts, but for pages no context is displayed. It finds the pages, but does not show context.

    A less desirable, but still useful output would be to show the defined excerpts for posts and pages. Pages do not usually have excerpts but they can be enabled. Unfortunately the search results only display excerpts for posts.

    I am using the Oxygen EasyPost block to display the search results. This block calls the PHP “the_excerpt()” function to get the text. It does not appear that this gets any results for pages.

    Any help will be appreciated.

    — ted

    #41903
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You can try a few things here.

    First, try to switch this option, so the shortcodes are being executed before the context is tested. If all goes well, that alone may help.
    If not, then maybe switch up the primary and secondary content fields like this.
    That way if the ct_builder_shortcodes field exists and is not empty, then it will be used as the primary field.

    Best,
    Ernest Marcinko

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


    #41926
    tedl00
    tedl00
    Participant

    Hi Ernest,
    I think that you nailed it.

    I needed to use both the primary and secondary description fields to show context for both pages and posts.
    Primary -> content
    Secondary -> ct_builder_shortcodes

    It also appears to be necessary to use the index search rather than regular search. The regular search seems to miss things.

    Finally, the pages have to be published to be searched. I knew that but, one of the pages had been left in the “Pending Review” state and of course it did not show up in my searches.

    Thanks for all your help.

    — ted

    #41933
    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 :)


    #41939
    tedl00
    tedl00
    Participant

    ok. Thanks again.

    — ted

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

The topic ‘Searching page contents’ is closed to new replies.