<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay 7.1 Custom web content search</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112702284" />
  <subtitle>Liferay 7.1 Custom web content search</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112702284</id>
  <updated>2026-04-04T22:30:38Z</updated>
  <dc:date>2026-04-04T22:30:38Z</dc:date>
  <entry>
    <title>RE: Liferay 7.1 Custom web content search</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112782801" />
    <author>
      <name>Steve Weiss</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112782801</id>
    <updated>2019-03-15T18:32:34Z</updated>
    <published>2019-03-15T18:32:34Z</published>
    <summary type="html">I went with the simplest solution, look up the datasource using JNDI and write a simple SQL query to query the localization table. This is not ideal and it would certainly be preferable if the Liferay API provided the local service classes for that table.</summary>
    <dc:creator>Steve Weiss</dc:creator>
    <dc:date>2019-03-15T18:32:34Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.1 Custom web content search</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112782459" />
    <author>
      <name>Amos Fong</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112782459</id>
    <updated>2019-03-15T18:27:17Z</updated>
    <published>2019-03-15T18:27:17Z</published>
    <summary type="html">hm...normally you would get the dynamicQuery using the localservice like this &lt;a href="https://community.liferay.com/forums/-/message_boards/message/88776488"&gt;https://community.liferay.com/forums/-/message_boards/message/88776488&lt;/a&gt;. However it looks like JournalArticleLocalization doesn&amp;#39;t have a localService...&lt;br /&gt;&lt;br /&gt;I&amp;#39;m not sure what your query involves, but if you could do an index search that would probably best. (And write a indexPostProcessor to index more fields from any joins you need)&lt;br /&gt;&lt;br /&gt;If you need a short term solution, I think you&amp;#39;ll need to get the classloader for the journal-service module which I &lt;em&gt;think &lt;/em&gt;is available in ClassLoaderPool or ServletContextClassLoaderPool. This should be avoided if possible though.</summary>
    <dc:creator>Amos Fong</dc:creator>
    <dc:date>2019-03-15T18:27:17Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.1 Custom web content search</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112702283" />
    <author>
      <name>Steve Weiss</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112702283</id>
    <updated>2019-03-12T19:35:35Z</updated>
    <published>2019-03-12T19:35:35Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I have a custom search application originally developed for LR 6.2. It also worked with 7.0 but there are changes in 7.1 that cause a problem searching web content (journal articles). This is a result of the TITLE and DESCRIPTION fields being taken out of the JOURNALARTICLE table and moved into JOURNALARTICLELOCALIZATION. The original search code can't search on those fields now, so I added some code to search the new table:&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; ClassLoader cl = PortalClassLoaderUtil.getClassLoader();
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; DynamicQuery q = DynamicQueryFactoryUtil.forClass(JournalArticleLocalization.class, cl);&lt;/code&gt;&lt;/pre&gt;The code builds but unfortunately, an exception is thrown at that second line:&lt;pre&gt;&lt;code&gt;2019-03-12 19:24:26.376 ERROR [http-nio-8080-exec-2][DynamicQueryFactoryImpl:107] Unable find model com.liferay.journal.model.impl.JournalArticleLocalizationImpl
java.lang.ClassNotFoundException: com.liferay.journal.model.impl.JournalArticleLocalizationImpl
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1275)
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1104)
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.getImplClass(DynamicQueryFactoryImpl.java:129)
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.getImplClass(DynamicQueryFactoryImpl.java:95)
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.forClass(DynamicQueryFactoryImpl.java:45)
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;at com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil.forClass(DynamicQueryFactoryUtil.java:29)
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;at gov.nasa.hq.liferay.search.journal.JournalSearch.getArticlesLocalized(JournalSearch.java:576)&lt;/code&gt;&lt;/pre&gt;I can see that the class in question (JournalArticleLocalizationImpl) is in the journal-service module, I don't understand why this exception is thrown.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Steve Weiss</dc:creator>
    <dc:date>2019-03-12T19:35:35Z</dc:date>
  </entry>
</feed>
