Score:0

SOLR displays "submitted by username" only for the Article content type. How do I stop this?

br flag

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.

Score:2
cn flag

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.

ACanadianCoder avatar
br flag
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.
cn flag
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.
cn flag
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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.