Indexing Entity without storing to DBIndexing Entity without storing to DBhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1209146252024-03-28T16:41:56Z2024-03-28T16:41:56ZRE: Indexing Entity without storing to DBRussell Bohlhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1209503232021-07-15T14:30:07Z2021-07-15T14:30:06Z<p>Now that I come back to this Nishith, I'm going to conclude that you
cannot do this on Liferay 7.0. I believe it was Liferay 7.2 that
introduced the idea of applications using their own index as their
primary storage. But you would not be doing this in a SB app.</p>
<p>Some of the DXP apps that use it are Synonym Sets and Result Rankings.</p>
<p>This ticket for documentation has some code snipopets (they look like
they're for 7.2).</p>
<p>
<a href="https://issues.liferay.com/browse/LRDOCS-7653">https://issues.liferay.com/browse/LRDOCS-7653</a></p>Russell Bohl2021-07-15T14:30:06ZRE: RE: Indexing Entity without storing to DBNishith Lakhlanihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1209261502021-07-07T21:09:46Z2021-07-07T19:56:00Z<p>@Russel<br /> I have already tried removing the annotation. It
<strong>DOES NOT</strong> help.</p>Nishith Lakhlani2021-07-07T19:56:00ZRE: RE: Indexing Entity without storing to DBRussell Bohlhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1209253242021-07-07T16:30:48Z2021-07-07T16:30:47Z<p>Okay, your indexing code looks fine to me, and search and indexing is
working as expected using the usual mechanism. I think one easy thing
you should try is removing the @Indexable annotation from the method.
I don't know all that this does, but it's probably kicking off an
indexing action (delete or reindex) whenever a persistence call is
made. I don't know why it would get in the way of your manual indexing
code, but it might be a feature of the annotation (sanitize any other
indexing calls that might interfere, or something). I'm on a limb with
these guesses, but removing teh annotation is probably worth a shot,
if you haven't already.</p>Russell Bohl2021-07-07T16:30:47ZRE: RE: Indexing Entity without storing to DBNishith Lakhlanihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1209248942021-07-07T16:23:31Z2021-07-07T15:40:21Z<p>@Russel<br /> Yes. If I add the </p>
<p>
<strong>entryPersistence.update(entry);</strong>
<br />
<br /> The entry gets indexed. Once I remove that line. It does not index.</p>Nishith Lakhlani2021-07-07T15:40:21ZRE: RE: Indexing Entity without storing to DBRussell Bohlhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1209248552021-07-07T15:27:33Z2021-07-07T15:27:33Z<p>Nishith, did you test the sample? Is search and indexing working
before you change anything?</p>Russell Bohl2021-07-07T15:27:33ZRE: RE: Indexing Entity without storing to DBNishith Lakhlanihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1209228472021-07-07T12:59:43Z2021-07-07T05:57:50Z<p>I am looking for solution for DXP 7.0<br /> I have used liferay
sample guestbook entry entity for POC.<br /> I want to save entity to
search index but not store in database.<br /> So in the
EntrylocalServiceImpl ,I have removed the line</p>
<p>
<strong>entryPersistence.update(entry);</strong></p>
<p>I have replace it with following code:</p>
<p>
<strong>Indexer<Entry> indexer =
IndexerRegistryUtil.nullSafeGetIndexer(Entry.class);<br /> indexer.reindex(entry);</strong></p>
<p>but it doesnt trigger index and the doReindex method of the
EntryIndexer class is not getting invoked.<br /> Any alternative to
achieve this?</p>Nishith Lakhlani2021-07-07T05:57:50ZRE: Indexing Entity without storing to DBOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1209208932021-07-06T11:48:38Z2021-07-06T11:48:37Z<p>Yes, of course you can. The framework does not care where you get the
data (that you display) from.</p>Olaf Kock2021-07-06T11:48:37ZIndexing Entity without storing to DB