ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Showing comments in search results

June 20, 2011 3:33pm

Subscribe [3]
  • #1 / Jun 20, 2011 3:33pm

    vosSavant

    380 posts

    We have a client who would like to display comments in the search results. Say I search for “potatoes” and there is an entry called “How to cook potatoes” and a comment that reads “I really like potatoes.” We’d like the search results to show something like:

    Your search for "potatoes" yielded 2 results:
    
    1. How to cook potatoes
    
    2. I really like potatoes

    Currently using the simple search form with search_in=“everywhere” and the example search results template does not accomplish this; indeed, searching for keywords within comments that exist does not return results at all.

    I found a forum thread about this where this was tracked as a bug that was resolved. Is the inability to find comments in searches the result of user error, or is the simple search form not capable of returning comments as I’d like?

    Any help is much appreciated.

  • #2 / Jun 21, 2011 7:10am

    John Henry Donovan

    12339 posts

    Hi Ryan,

    the Simple search form will search associated comments meaning that the results will show the entry itself.
    Your example results is not possible out of the box as the results form only allows you to use the Channel Entries Tag Variables.

    There is an add-on called Search Results which really beefs up functionality for this page. You could query them to see if what you wish is available

    Other than that you are welcome to make a feature request

  • #3 / Jun 21, 2011 12:40pm

    vosSavant

    380 posts

    Thanks John!

    I’m still not getting entries to show by searching comments…I’m going to look deeper as I’m sure it’s user error.

  • #4 / Jun 22, 2011 12:57pm

    Brandon Jones

    5500 posts

    Hi Ryan,

    Make sure you’re testing with a really simple template to begin with. Also, I wasn’t sure what version and build you were on. Keep us posted on your progress.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases