Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Searching page contents
This topic contains 6 replies, has 2 voices, and was last updated by tedl00 1 week, 2 days ago.
- AuthorPosts
- March 19, 2023 at 3:06 am #41875
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
March 20, 2023 at 12:42 pm #41888Hi 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.
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 20, 2023 at 2:18 pm #41894Hi 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
March 21, 2023 at 11:21 am #41903You 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.
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 22, 2023 at 2:01 pm #41926Hi 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_shortcodesIt 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
March 23, 2023 at 3:42 pm #41933You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 23, 2023 at 4:52 pm #41939ok. Thanks again.
— ted
- AuthorPosts
The topic ‘Searching page contents’ is closed to new replies.