Jump to content

Show search results as posts


Feld0

Recommended Posts

Would it be possible to make it so search results from the search bar can be displayed as posts rather than topic titles? I know this can be done from the advanced search form, and also from the "Find content" button on a member's profile.

I find that most of the time, when I'm searching for term X, I look for where exactly X was mentioned on my forum. Displaying the search results as topic titles makes it impossible to quickly find the exact posts where X was said, and going through advanced search for it is more than a little cumbersome.

Something as simple as a drop-down option would solve this, like in the screenshot I've attached from a forum that does this. Perhaps it should also be an option in the ACP or user CP to set a default for how search results should be displayed? The code that does this is already clearly in the core, but I just find it puzzling that it's impossible to show results this way from the search bar.

Link to comment
Share on other sites

I had a peek through the source files, thinking I might find out where the search query from the search bar is being generated so I could change how the results are shown by default (it can't be more than a simple variable, can it?), but I couldn't find it.

When finding a member's content, there is an option to see the results as posts, as in the attached screenshot. Why can we not have this option on regular search pages, too?

Link to comment
Share on other sites


You're not opting to "see" them as posts, you are opting to look just for the posts a member made. This is a fundamental difference in how the "find user content" works, not just changing how the results are displayed.



I understand that there's a difference in how the functionality works, but I was only using the example of "find user content" to demonstrate more or less what I'm suggesting, which is otherwise irrelevant to that button.

Perhaps this screenshot is more appropriate:

post-205296-0-49663300-1313034093_thumb.

When you go to advanced search, you have the option to see the results as a list of topics or the posts themselves. Results in the form of a topic list are virtually useless when you're looking for a specific post that was made on a thread more than several pages long. As I and several other members have expressed on this thread, the majority of the time, this is our desired way of searching.

Setting the option I highlighted in the screenshot accomplishes exactly what we're looking for. So, my question is: why can we not have the option to search this way from the quick search bar at the top of the board? Or at least, can we get some instructions on how we can change the default search behaviour of that bar to act as if the option to display results as posts had been selected? I can hardly imagine this being a complicated edit.
Link to comment
Share on other sites

You can certainly add a hidden input field to your skin (quickSearch template I think it is) that sets the same parameters as clicking the radio button on the advanced search page would. It would take all of 5 minutes to make the skin edit I imagine.

Link to comment
Share on other sites

  • 2 weeks later...

i agree, this should be an option available on acp to allow webmaster to show post result wether to be as a thread result or as post, i knwo alot of my users want too post content directly and having to click the thread to just see the content is just too many clicks and time consuming. The search default for member search, searching own post content and others should be made available as an selectable option for show post result as post/thread

Link to comment
Share on other sites


You can certainly add a hidden input field to your skin (quickSearch template I think it is) that sets the same parameters as clicking the radio button on the advanced search page would. It would take all of 5 minutes to make the skin edit I imagine.



I did that, and added the hidden field to my skin. It works, but I think I realized exactly what you meant now with the difference between displaying the results as posts, and searching for a member's posts. I realized that displaying the search results as posts returns only one result per topic - my bad.

So... in that case, maybe there isn't any code in the core to return every single post on the forum that has a search query in it, after all. Any chance of this ever being added in a future version (or perhaps there's a different edit that I'd need to make)?
Link to comment
Share on other sites

  • 1 year later...

I really think this should be an option. Topics on many boards end up being hundreds of pages, so knowing which topic a search term is in is almost always useless. Since the show as posts option is relatively hidden, on the advanced search page, I find that many users simply don't know how to find what they are looking for. I was able to change the default option on the advanced search page and also change the quick search results.

To change quick search, I added:

<input type='hidden' name='search_app_filters[forums][noPreview]' value='0'/>

to Global Templates -> quicksearch

right after the <form ...> line to set the same option as on the advanced search page. Seems to work perfectly, and I don't have the same issue as the previous poster where only one item per topic is shown.

To change the default value on the advance search page, I changed

Search -> forumAdvancedSearchFilters

find

<input type='radio' name='search_app_filters[forums][noPreview]' value='0' /> {$this->lang->words['s_forum_asposts']}&nbsp;&nbsp;&nbsp;
<input type='radio' name='search_app_filters[forums][noPreview]' value='1'  checked="checked"/>

and just move the checked ="checked" to the first radio button like this:

<input type='radio' name='search_app_filters[forums][noPreview]' value='0' checked="checked"/> {$this->lang->words['s_forum_asposts']}&nbsp;&nbsp;&nbsp;
<input type='radio' name='search_app_filters[forums][noPreview]' value='1'  />
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...