掲示板

How to remove images from search?

thumbnail
9年前 に Mark Hyde によって更新されました。

How to remove images from search?

New Member 投稿: 12 参加年月日: 13/03/20 最新の投稿
We are placing images in the Document and Media library that are then used as elements of building web content blocks on pages.
When using search, the individual images are being returned in the search results. We do not want this to happen.

I have been exploring all the advanced facet configuration and search in general, but cannot find anything that talks about excluding items from search.

Web Content items have a the searchable check box, but the individual Document and Media assets do not.

Is there a method for excluding images from search results?

Conversely, is there a way to configure the asset categories facet to return only an explicit list of file types?

Thanks,
mark
thumbnail
9年前 に Mark Hyde によって更新されました。

RE: How to remove images from search?

New Member 投稿: 12 参加年月日: 13/03/20 最新の投稿
Ok, so it appears that there is no way to exclude images in the document library from being indexed and returned in searches. Liferay support had no answer either.

Am I the only one to have this issue of not wanting the images to show up in the search results? It's really disconcerting to get a list of documents back and have a bunch of image results mixed in.

For the content creators, it's a pain to pull all of the images out of the library and make them have to do external references to include them in web content.

Any thoughts from any one on how to tackle this problem?

Thanks,
mark
thumbnail
9年前 に Renata Willi によって更新されました。

RE: How to remove images from search?

Junior Member 投稿: 30 参加年月日: 13/02/15 最新の投稿
Hi Mark,

I have the same problem. I want to show only web content articles and PDF files from the Docuements and Media library.
Which Liferay version are you using? I'm still on 6.1...

I posted my solution in this thread: https://www.liferay.com/de/community/forums/-/message_boards/message/44103857

But now I have the issue that all the relevant PDF files are shown first in the search result and only after them the relevant Web Content Articles. I don't understand, why the search result is sorted this way now and not according search relevancy?

Best regards,
Renata
thumbnail
9年前 に Andew Jardine によって更新されました。

RE: How to remove images from search?

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
Hey Guys,

Definitely a thorn in my side as well. I wish it was easier to customize the search results and query. To date the only way I have been able to manage this is through hooks and classes in the TOMCAT_HOME/lib/ext for customized searching. This search results pages -- https://www.sprouts.com/home?p_p_id=3&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_3_struts_action=%2Fsearch%2Fsearch&_3_redirect=%2F&_3_keywords=tomato&_3_groupId=0&x=0&y=0 for example is a JSP hook where I override the search portlet pages to customize the layout and the look and feel.

More recently I had another project where we needed to force the category ID with the initial query, not just as a facet. To manage that I had to create a CustomFacetedSearcher that extended the FacetedSearch and then used an override to the search (doSearch depending on your version) to leverage the categoryIds, if present in the search context, when building the context query object. That class had to be packaged and pushed into the TOMCAT_HOME/lib/ext. I then hooked the main_search.jspf page and modified the class used to use the CustomFacetedSearch and set the categoryIds on the search context object.

An esaier way to template search results, or to plugin a "searcher" is something on my list of projects I would like to do and contribute back to Liferay for others. Just need to find some more time first! emoticon
thumbnail
8年前 に Mark Hyde によって更新されました。

RE: How to remove images from search?

New Member 投稿: 12 参加年月日: 13/03/20 最新の投稿
Thanks for the responses. Yes, I'm still on 6.1 and this does seem to be a glaring hole. We are now seriously considering pulling all the images from the Document and Media library, managing them externally, and serving them up direct from the web server. It would probably be a performance boost, but it sure takes away from the content management aspect of using Liferay.

mark