0

No matter what I do, I can't seem to remove the Submitted by [username] from popping up in my search results for the Article content type. I'm using the Apache SOLR module. If you visit the article page itself, I never actually display this information, so showing up on the search results page is confusing me.

When I go to manage fields for my search results, I've got the following for content (I removed username but that didn't help).

content fields

When I look into my General fields and edit Rendered item, the view mode for article content type is set to default.

general fields

view mode for article

When I check my default display fields, it is the following.

default display

Yet, when I search for a username in search, admin for this example, I get the following results on the page.

Search results

Why is it still showing submitted by admin in the results and how can I actually remove it? I've tried a couple of preprocess functions that I found while searching but nothing seems to work. (Yes, I've cleared my cache after every change in code.) Any suggestions or pointing in the right direction would be greatly appreciated.

2

What you are seeing with the "submitted by" is coming from search result excerpt. This can be configured in a few different ways, but basically, when the node is being indexed, that information is being rendered out behind the scenes and added to the index.

If you want to remove that, you would want to either remove author information from rendering in the first place, which can be accomplished in a few ways; or change the way the data is added to the SOLR index.

The simplest thing would be to edit your node types uncheck the "Display author and date information" box. Make sure to reindex your content.

3
  • Appreciate the answer, and I did look into that (it worked), however, I would still like the date info intact as that part of it is displayed on the article, as well as that's the order the articles are sorted by. I wish the "Display author and date information" was separated as I'd like the one but not the other. Jul 29 at 19:24
  • You can also adjust the excerpt. If you go to manage display for your content types you can enable the "search result excerpt" view mode. Maybe you would have better luck with that? Otherwise you would want to sort out how to index the entity without the author data displaying. Jul 29 at 19:59
  • 1
    You could create a new view mode, make it identical to the original but without the submitted by, and use that view mode for the indexing. Trade offs are that submitted by is no longer searchable, and you'll have to maintain the second view mode alongside the first one for consistency
    – Clive
    Jul 29 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.