Override search results page

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Override search results page

This topic contains 40 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 9 months ago.

Viewing 15 posts - 16 through 30 (of 41 total)
  • Author
    Posts
  • #6944
    optimalpartners
    optimalpartners
    Participant

    To make things easier with the selector thing,

    For now I won’t have the CPTs listed, so I will need to have:
    Feeds (post type)
    Products (post type)
    Free Project Resources (post category)
    Articles (post category)
    Jobs (feed category)
    But I’d like them to be in one clean list rather than separated by “Post Type” “Categories” or “Feed Categories” Just like how I don’t want someone to have to click on both feeds and jobs in order to display the jobs (all jobs are a type of feed)
    Then in the results, I’d like them to be sorted as:
    Pages
    Articles
    Free Project Resources
    Feeds
    Products
    Jobs
    Rather than Posts, Pages, Other…. Or Articles, Free Resources, Other

    Then once I have all of my CPTs saved and original posts removed, I’d like to have
    Articles (CPT)
    Resources (CPT)
    Consultants (CPT)
    Feeds (post type)
    Products (post type)
    Jobs (feed category)
    And then in the results, I’d like them sorted as:
    Pages
    Articles
    Resources
    Feeds
    Products
    Jobs

    I hope this helps clarify what I tried to explain above.

    #6990
    optimalpartners
    optimalpartners
    Participant

    If you could help with the issues in these last couple of posts as soon as possible that would be great, as we need the filtering sorted out before we add this plugin to our production environment, and ideally we would like to do that in the next few days/week.

    Thanks again! I really appreciate it!

    #6991
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Sorry for the late response, I had a few tickets ahead of your responses I had to take care of yesterday.

    I think I’m probably getting the picture of what you need. Putting an OR relation between the category/term selectors and the post_type selectors is not going to work. You might think the search selects items matching the post type, then matching the category selectors, and then returning the matching elements from both subsets – but it’s not as simple like that. There are for example elements without terms, or missing selectors for terms, which make the query 100 times more complicated.
    I’ve made the change in the code from “AND” operator to “OR” operator between the post_type and the terms query, you can try the search now, but I don’t think it will give you the expected results.

    I removed the category header texts on the Layout Options panel and applied some custom CSS to make it look better, so it now displays as a single list of custom post type and category selectors.

    And for the results group ordering. Well that’s currently not possible to change. Someone else asked the same thing a week ago or so, and I tried to make it work for him, but I couldn’t. That part of the plugin is probably one of the oldest (almost 2 years), and that time I wasn’t thinking of a possibility of changing the order of the groups in the results (per custom post type). The current state of that code is not ready for this modification, the only thing I can do is re-write that whole section from scratch. It’s of course planned, and the next thing on the features list, as it’s a valid request to have that – it just didn’t came up until previous week, and I didn’t think of that feature earlier, I’m sorry.

    Best,
    Ernest Marcinko

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


    #7098
    optimalpartners
    optimalpartners
    Participant

    Hi, Thanks again for all the help! Just a few other things I’m noticing as I’m changing some of the settings.

    1. Is it possible to re-order the filters?
    2. I’d like to rename the filter “Jobs” to “Jobs Feed” Jobs is a category of the newsfeeds CPT.
    -Also with Jobs, from my understanding, if you select jobs, you must also select Newsfeeds since jobs is a category within newsfeeds. However is there any way we can make it so they do not need to select both?
    3. I’m wondering if it’s possible to have the filters be remembered for the next search that a user performs. This is something that my supervisor says is highly important and may not have filters as an option for users.
    4. Also since the last changes you made, we’ve noticed code comes up at the top of the page when we do a search (see screenshot)
    5. We did a search for “higher” and selected only Other Pages as a filter and on page 3 we are getting a 404 error, I think this is similar to an issue you said was with wordpress but you had applied a fix.
    6. Also I was looking into the index table option, and I’m wondering if it would work for us as I read that the index table allows for a faster search. My concern is that with the feeds being pulled in, the index table may not get updated properly, especially as not too long ago we were having several issues with our caching plugin affecting some of our dynamic content.
    7. Also, sometimes when searching only under “Articles & Resources,” I still get Page results in the preview. (See screenshot)
    8. When we display results from newsfeeds, the description displays in a single paragraph tag, where it should really be separated into several parts. I looked into the plugin that allows them to be pulled in, and they actually don’t allow for feeds to come up in search by default, and they do not have an option to change it. The support for the rss plugin told us we need to create a custom search template for the rss posts. To me, this means that they are showing in search because I selected in this search plugin to search those types of content–which is exactly what I want, but it seems as though this plugin is somehow stripping the html that is normally part of those entries–the text is all jumbled, the source, date, and author is lumped in with the rest of the description, and we need to be able to separate them and style it all separately. (see screenshot)
    9. Lastly, for some reason, some of the behind the scenes types are showing in search results. For example, “Types Groups” “Content after Posts” “Feedback” “Views” I think these are all things from other plugins. These are the only ones I’ve found in the results, but I’m concerned that there could be others. I looked through all of the options for how to exclude things from search and I’m unable to specify for any of these to not show.

    Attachments:
    You must be logged in to view attached files.
    #7142
    optimalpartners
    optimalpartners
    Participant

    Hello again, I’m working on adding additional types of content to our blog and as I’m in the process of adding them, I’ve also done a bit of testing to search for the new content and I’m unable to search for them in the way I’d like.

    A bit of background. I’m creating custom post types for “consultants” and “peers” each have similar, but slighty different custom fields associated with the post types, and similar taxonomies (taxonomies haven’t been fully decided on yet) So in order to avoid copying the formatting for every new consultant and peer, I’m using content after posts so that the same information (pulled from custom fields for each entry) to pull the shortcodes from the custom fields. I’m able to search the title, however I need to somehow search those custom fields and they do not appear in the search plugin settings. I also tried to have it run the shortcodes and not strip them from the results, but that also did not seem to work. I’m hoping there’s a way to search through the content in these fields on these pages as it will allow us to enter them in a much cleaner way. The alternative is entering all of the same fields in a main block of text.

    Thank you for all your help!

    #7171
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Are you sure that those are custom fields indeed? If so, they should appear on the settings page.
    Do you know the names of those fields? They might be set to private and have an underscore “_” character before their names.

    There is also a limit for listing custom fields on the search options page, but it’s set to 500. I counted the items there with javascript, there are 242 fields there currently, so it’s not that.

    If you tell me the names of the custom fields, I might be able to investigate why it’s not there.

    Best,
    Ernest Marcinko

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


    #7189
    optimalpartners
    optimalpartners
    Participant

    Hi, Yes, here are the names of the custom fields, they are created and stored in the WP Types plugin.

    For consultants:
    first-name
    specialties
    consultant-experience
    resume (This I have as a placeholder, depending on what we can do with search we may or may not use it. We were thinking of having a hidden field that can be searched, but we may decide against that)

    For peers:
    first-name (same field as for consultants)
    university
    specialties (same field as for consultants)
    consultant-experience (same field as for consultants)
    resume (same field as for consultants)
    email

    The fields are very similar, but the actions for the user are different and we are sorting them separately so they appear differently in the site. Also, the fields must be displayed using shortcodes (annoying, but just how WP Types works) and so rather than pasting the shortcodes into every main body section for every peer and consultant, we are using the Content After Posts plugin to display the style classes and shortcodes on every one of those posts (“after” the main–blank– content) despite the fields being in the editor for each individual post.

    Also prior to the last message, (Dec 16) I had submitted a support request and some of those issues are extremely urgent as we are getting code at the top of the screen and also having an issue with our hosting provider and I think that issue may be causing it. Also several other configuration questions if you could respond to those as well.

    #7214
    optimalpartners
    optimalpartners
    Participant

    Hi, I just wanted to make sure this issue didn’t get buried. There were several issues I mentioned above in a post from 12/16 that I think were missed. These issues are very important as we think we are very close to moving the search to our production site, however we want to make sure these issues are cleared up first. Also there was some clarification I made about the custom fields for searching through the details on our custom post types. I know with the holidays things can get busy and I just wanted to make sure this didn’t get lost. Thank you again for all your help!

    #7217
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Sorry about the late response. No worries, I’m answering every ticket in order as fast as possible 🙂

    1. Re-ordering the filters is only possible on a per-group basis on the Frontend Search Settings panel: https://i.imgur.com/TqUm9R4.png
    Some of the individual filters are hard-coded, plus the term filters cannot be custom ordered (not available in WordPress yet).

    2. You will have to rename the term from “Jobs” to “Jobs feed” and it should solve it.

    3. It’s not possible. I’m planning to implement this feature in the future. Since the plugin was made mainly for Ajax use, this was not considered until just recently. Unfortunately there is no quick workaround I could suggest.

    4. Indeed, my bad. I forgot to remove 1 line that I’ve added for debugging. It should be gone now.

    5. Actually, it was because of the recent modification I made regarding the post types and terms. I’ve had to add additional code, because the default search results page was not getting posts as it should. It should be all right now.

    6. I would not recommend that in your case. I’ve already made modifications to the regular engine code as per your request. They would not work with the index table engine.

    7. Yes, because of your previous request of putting an OR relation between the post type and term selectors. Since pages are not part of any terms they are considered as possible results for the database query. That is another good reason not to use these selectors in an OR relation. It might lead to other unexpected results as well.

    8. and 9. – I’m gussing you are reffering to the non-ajax results page. The layout and content on that page is purely determined by the search.php file in your active theme directory. To change this behavior you will have to make changes to that file directly. Ajax Search Pro only tells the main search query to get different posts from what it would by default – but it does not change their content in any way.

    Best,
    Ernest Marcinko

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


    #7258
    optimalpartners
    optimalpartners
    Participant

    Thank you so much!

    For #9, It’s actually only an issue within the AJAX results (see the screenshots from the 12/16 post) Those “types” of content are more for behind the scenes and should not be coming up in results, I’m not sure why they are coming up now when originally they didn’t. (I also can’t find where to exclude them as they aren’t listed in the normal exclude section)

    #7264
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are welcome!

    #9 – It still was the problem with the “OR” relation. I made another modification, but I’m not sure if it’s working correctly. It adds another clause to check all possible selected post types with the terms. It should not display the unselected internal post types anymore.

    Best,
    Ernest Marcinko

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


    #7270
    optimalpartners
    optimalpartners
    Participant

    Thank you so much for all the help!! It works great!

    My question now is what is the best way to move it from our development environment into production? I tried copying the plugin file over to the production directory hoping that all of my settings would stay the same, but it seems to be a brand new copy of the plugin. Is there an easy way to move it over?

    Also once the search is moved over, I’m going to be working on having separate instances of the search for specified custom post types, I mentioned a few messages back about custom fields not being searchable.

    Thank you again!

    #7281
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    The search settings are stored in the database of course, so when moving, don’t forget to copy the database as well. Or ate lease these 4 tables:

    wp_ajaxsearchpro
    wp_ajaxsearchpro_priorities
    wp_ajaxsearchpro_statistics
    wp_asp_index

    You can also try using some kind of migration plugin, I heard some of them work pretty well.

    Best,
    Ernest Marcinko

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


    #7293
    optimalpartners
    optimalpartners
    Participant

    Thank you! It’s working!

    I’m also looking to have a separate instance of the search to only search through “Jobs” these are a category of WP RSS feed items. Right now it is configured to search through the feed items, but I can’t get it to only search that one category. Any suggestions? Here’s the page that the jobs search is located: http://blogdev.optimal-partners.com/feeds/

    #7301
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    On the Advanced Options panel try excluding all other taxonomy terms, that hopefully does the trick: https://i.imgur.com/ijCX4xj.png

    Best,
    Ernest Marcinko

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


Viewing 15 posts - 16 through 30 (of 41 total)

You must be logged in to reply to this topic.