core icon indicating copy to clipboard operation
core copied to clipboard

Query Tool: Tags are not included in the retrieved Content Maps

Open joseorsini opened this issue 10 years ago • 4 comments

Reproduced in 3.6.0, on our demo.dotcms.com site. Related to Support Ticket, from client running dotCMS 3.5.1: https://my.dotcms.com/tickets/detail.dot?id=27ba47f8-b1bf-41bb-8e19-2f1cdebfa608

Current Behavior

Once the results from a Lucene Query are retrieved, we're not displaying values for tags fields (in case the Content Type where we're pulling contents has a Tag field).

Expected Behavior

The lucene_Search.jsp file tries to generate a Map out of each retrieved contentlet, however, this method

https://github.com/dotCMS/core/blob/master-3.6/src/com/dotmarketing/portlets/contentlet/business/Contentlet.java#L1645

Does not take into account Tags fields, because they're not saved directly on the Contentlet record. We would need to pull Tags from the TagInode Cache Region (which will hit the DB in case nothing is pulled from Cache). We should be able to pull a list of tags, in the same way the ContentMap.java class does for frontend pulls.

Steps to Reproduce

  1. Login to demo.dotcms.com site.
  2. Go to Query Tool portlet.
  3. Use the following Lucene Query +contentType:calendarEvent for searching contents.

This is an example of a retrieved content map:

1.  Title:  dotCMS Online Training Session (w/ Image)
    Inode:  62c55db8-7dbf-4ba1-a424-e3025815d5f6
    Identifier: 9f303322-a908-4df0-8194-e1323f11b008

{modDate=2015-03-10 13:19:49.42,
endDate=2015-12-25 16:00:00.0,
link=http://dotcms.com,
description=<p><img src="/dotAsset/461b2fa3-fb97-442e-b9ca-19e96d683f65.jpg" style="margin: 10px; float: right;" height="334" width="250" />Want to learn how to get the most from your dotCMS installation? This Webinar can help you. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh,
viverra non,
semper suscipit,
posuere a,
pede. Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis.</p>
<p>Morbi in sem quis dui placerat ornare. Pellentesque odio nisi,
euismod in,
pharetra a,
ultricies in,
diam. Sed arcu. Cras consequat.</p>
<p>Praesent dapibus,
neque id cursus faucibus,
tortor neque egestas augue,
eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi,
tincidunt quis,
accumsan porttitor,
facilisis luctus,
metus.</p>,
title=dotCMS Online Training Session (w/ Image),
recurrenceOccurs=weekly,
recurrenceDayOfWeek=3,
inode=62c55db8-7dbf-4ba1-a424-e3025815d5f6,
file=2896c216-9d15-49b0-9ff9-6bfff113cc4a,
disabledWYSIWYG=[],
recurrenceEnd=2015-03-10 00:00:00.0,
recurrenceDayOfMonth=0,
host=48190c8c-42c4-46af-8d1a-0cd5db894797,
lastReview=2015-03-10 13:19:49.415,
recurrenceStart=2015-12-25 15:00:00.0,
stInode=f6259cc9-5d78-453e-8167-efd7b72b2e96,
recurrenceWeekOfMonth=2,
recurs=false,
owner=dotcms.org.1,
identifier=9f303322-a908-4df0-8194-e1323f11b008,
image=9825d1e6-c89f-4110-af92-a242bb42345b,
noRecurrenceEnd=false,
urlTitle=dotcms-online-training-session-w-image,
languageId=1,
recurrenceDaysOfWeek=1,2,3,4,5,6,7,,
tags=,
recurrenceInterval=1,
folder=SYSTEM_FOLDER,
recurrenceDatesToIgnore=1318433280000 1352476800000 1356105600000,
recurrenceMonthOfYear=3,
sortOrder=0,
modUser=dotcms.org.1,
startDate=2015-12-25 15:00:00.0}

As you can see, tags field is empty, however, if you open the content, meeting and training tags are added to the content.

screen shot 2016-09-07 at 11 23 38 am

joseorsini avatar Sep 07 '16 15:09 joseorsini

PR: https://github.com/dotCMS/core/pull/9924

agomez-dotcms avatar Oct 10 '16 14:10 agomez-dotcms

Passed QA. Tags are showing when you run a Lucene Query +contentType:calendarEvent. See below:

9.  Title:  dotCMS Online Training Session (w/ Image)
    Inode:  3dba98ba-b142-4aff-98bf-f762383dddd1
    Identifier:     9f303322-a908-4df0-8194-e1323f11b008

{modDate=2016-10-12 13:58:58.843, 
endDate=2015-12-25 15:00:00.0, 
link=http://dotcms.com, 
description=<p><img src="/dotAsset/461b2fa3-fb97-442e-b9ca-19e96d683f65.jpg" style="margin: 10px; float: right;" height="334" width="250" />Want to learn how to get the most from your dotCMS installation? This Webinar can help you. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede. Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis.</p>
<p>Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.</p>
<p>Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.</p>, title=dotCMS Online Training Session (w/ Image), 
recurrenceOccurs=weekly, recurrenceDayOfWeek=4, 
inode=3dba98ba-b142-4aff-98bf-f762383dddd1, 
file=2896c216-9d15-49b0-9ff9-6bfff113cc4a, 
__DOTNAME__=dotCMS Online Training Session (w/ Image), disabledWYSIWYG=[], 
recurrenceEnd=2016-10-12 00:00:00.0, 
recurrenceDayOfMonth=0, 
host=48190c8c-42c4-46af-8d1a-0cd5db894797, 
lastReview=2016-10-12 13:58:58.837, 
recurrenceStart=2015-12-25 14:00:00.0, 
categories=Webinars, 
stInode=f6259cc9-5d78-453e-8167-efd7b72b2e96, 
recurrenceWeekOfMonth=3, 
recurs=false, 
owner=dotcms.org.1, 
identifier=9f303322-a908-4df0-8194-e1323f11b008, 
image=9825d1e6-c89f-4110-af92-a242bb42345b, 
noRecurrenceEnd=false, 
urlTitle=dotcms-online-
training-session-w-image, languageId=1, recurrenceDaysOfWeek=1,2,3,4,5,6,7,, 

---> tags=brazil,germany,africa,

recurrenceInterval=1, 
folder=SYSTEM_FOLDER, 
recurrenceDatesToIgnore=1318433280000 1352476800000 1356105600000, 
recurrenceMonthOfYear=10, 
sortOrder=0, 
modUser=dotcms.org.1, 
startDate=2015-12-25 14:00:00.0}

Verified that existing tas are showing Verified that new tags are showing Verified that removed tags are not showing Verified that tags are showing thru the API

Tested on master-3.7 // Ubuntu 14.04.1 // Postgres 9.3.5 // Chrome

shaydotcms avatar Oct 12 '16 20:10 shaydotcms

merge into 3.7

jtesser avatar Jan 10 '17 18:01 jtesser

Merged into master-3.7: https://github.com/dotCMS/core/pull/10424

dsilvam avatar Jan 11 '17 14:01 dsilvam