{"action":"created","issue":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/2191","labels_url":"https://api.github.com/repos/IQSS/dataverse/issues/2191/labels{/name}","comments_url":"https://api.github.com/repos/IQSS/dataverse/issues/2191/comments","events_url":"https://api.github.com/repos/IQSS/dataverse/issues/2191/events","html_url":"https://github.com/IQSS/dataverse/issues/2191","id":79462888,"number":2191,"title":"Prefer full titles shown in search results","user":{"login":"garthg","id":1354795,"avatar_url":"https://avatars.githubusercontent.com/u/1354795?v=3","gravatar_id":"","url":"https://api.github.com/users/garthg","html_url":"https://github.com/garthg","followers_url":"https://api.github.com/users/garthg/followers","following_url":"https://api.github.com/users/garthg/following{/other_user}","gists_url":"https://api.github.com/users/garthg/gists{/gist_id}","starred_url":"https://api.github.com/users/garthg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garthg/subscriptions","organizations_url":"https://api.github.com/users/garthg/orgs","repos_url":"https://api.github.com/users/garthg/repos","events_url":"https://api.github.com/users/garthg/events{/privacy}","received_events_url":"https://api.github.com/users/garthg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Component:%20Search/Browse","name":"Component: Search/Browse","color":"c7def8"},{"url":"https://api.github.com/repos/IQSS/dataverse/labels/Type:%20Bug","name":"Type: Bug","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/IQSS/dataverse/milestones/28","html_url":"https://github.com/IQSS/dataverse/milestones/Candidates%20for%204.0.2","labels_url":"https://api.github.com/repos/IQSS/dataverse/milestones/28/labels","id":988772,"number":28,"title":"Candidates for 4.0.2","description":"","creator":{"login":"mcrosas","id":676040,"avatar_url":"https://avatars.githubusercontent.com/u/676040?v=3","gravatar_id":"","url":"https://api.github.com/users/mcrosas","html_url":"https://github.com/mcrosas","followers_url":"https://api.github.com/users/mcrosas/followers","following_url":"https://api.github.com/users/mcrosas/following{/other_user}","gists_url":"https://api.github.com/users/mcrosas/gists{/gist_id}","starred_url":"https://api.github.com/users/mcrosas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcrosas/subscriptions","organizations_url":"https://api.github.com/users/mcrosas/orgs","repos_url":"https://api.github.com/users/mcrosas/repos","events_url":"https://api.github.com/users/mcrosas/events{/privacy}","received_events_url":"https://api.github.com/users/mcrosas/received_events","type":"User","site_admin":false},"open_issues":33,"closed_issues":0,"state":"open","created_at":"2015-02-20T19:49:53Z","updated_at":"2015-06-14T21:26:00Z","due_on":"2015-07-01T04:00:00Z","closed_at":null},"comments":3,"created_at":"2015-05-22T13:50:26Z","updated_at":"2015-06-17T19:42:36Z","closed_at":null,"body":"Hi,\r\n\r\nWhen searching in a Dataverse, the search results are shown in a list in the right-hand pane. It appears that each result is having its title truncated sometimes, which makes the results unclear. For us it would be preferable if the full title was always shown. See attached screenshot for an example.\r\n\r\nThanks,\r\n\r\nGarth\r\n\r\n![screenshot from 2015-05-22 09 43 04](https://cloud.githubusercontent.com/assets/1354795/7771757/b7a634d8-0067-11e5-8883-de3ae0767154.png)\r\n"},"comment":{"url":"https://api.github.com/repos/IQSS/dataverse/issues/comments/112924562","html_url":"https://github.com/IQSS/dataverse/issues/2191#issuecomment-112924562","issue_url":"https://api.github.com/repos/IQSS/dataverse/issues/2191","id":112924562,"user":{"login":"pdurbin","id":21006,"avatar_url":"https://avatars.githubusercontent.com/u/21006?v=3","gravatar_id":"","url":"https://api.github.com/users/pdurbin","html_url":"https://github.com/pdurbin","followers_url":"https://api.github.com/users/pdurbin/followers","following_url":"https://api.github.com/users/pdurbin/following{/other_user}","gists_url":"https://api.github.com/users/pdurbin/gists{/gist_id}","starred_url":"https://api.github.com/users/pdurbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdurbin/subscriptions","organizations_url":"https://api.github.com/users/pdurbin/orgs","repos_url":"https://api.github.com/users/pdurbin/repos","events_url":"https://api.github.com/users/pdurbin/events{/privacy}","received_events_url":"https://api.github.com/users/pdurbin/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T19:42:36Z","updated_at":"2015-06-17T19:42:36Z","body":"## Option 1: Always show the full title\r\n\r\n> For us it would be preferable if the full title was always shown.\r\n\r\nThe most straightforward way to make the full title always shown is to simply never show the version with highlights. It would look something like this:\r\n\r\n![root_dataverse_-_2015-06-17_15 17 39](https://cloud.githubusercontent.com/assets/21006/8216449/9e1562e4-1504-11e5-9e66-8d4e521db692.png)\r\n\r\nNote that the word \"Garrison\" in the title is no longer in bold. This would be a change to what's currently written in http://guides.dataverse.org/en/4.0.1/user/find-use-data.html which says:\r\n\r\n> \"If the search term or query was found in the title or name of the dataverse, dataset, or file, the search term or query will be bolded within it.\"\r\n\r\nFor illustrative purposes, in the screenshot above I'm showing \"Title: of William Lloyd **Garrison**\" at the bottom of the card to show what it would look like if we placed the highlighted/matched title at the bottom with other fields that may match. We don't have to do this (we can continue to suppress \"title\" from being shown at the bottom) but it's an option.\r\n\r\nThe code change would look something like this:\r\n\r\n```\r\nmurphy:dataverse pdurbin$ git diff src/main/webapp/search-include-fragment.xhtml src/main/java/edu/harvard/iq/dataverse/SolrSearchResult.java\r\ndiff --git a/src/main/java/edu/harvard/iq/dataverse/SolrSearchResult.java b/src/main/java/edu/harvard/iq/dataverse/SolrSearchResult.java\r\nindex 19fdbe9..5998d64 100644\r\n--- a/src/main/java/edu/harvard/iq/dataverse/SolrSearchResult.java\r\n+++ b/src/main/java/edu/harvard/iq/dataverse/SolrSearchResult.java\r\n@@ -549,7 +549,7 @@ public class SolrSearchResult {\r\n                     && !field.equals(SearchFields.DESCRIPTION)\r\n                     && !field.equals(SearchFields.DATASET_DESCRIPTION)\r\n                     && !field.equals(SearchFields.AFFILIATION)\r\n-                    && !field.equals(\"title\")) {\r\n+                    ) {\r\n                 filtered.add(highlight);\r\n             }\r\n         }\r\ndiff --git a/src/main/webapp/search-include-fragment.xhtml b/src/main/webapp/search-include-fragment.xhtml\r\nindex 94f12f1..a04b714 100644\r\n--- a/src/main/webapp/search-include-fragment.xhtml\r\n+++ b/src/main/webapp/search-include-fragment.xhtml\r\n@@ -571,8 +571,7 @@\r\n                                         <span class=\"icon-dataset text-info pull-right\" title=\"#{bundle.dataset}\"/>\r\n                                         \r\n                                         <a href=\"#{result.datasetUrl}\" target=\"#{showFacets == true ? '_self' : '_blank'}\">\r\n-                                            <h:outputText value=\"#{result.title}\" style=\"padding:4px 0;\" rendered=\"#{result.titleHighlightSnippet == null}\"/>\r\n-                                            <h:outputText value=\"#{result.titleHighlightSnippet}\" style=\"padding:4px 0;\" rendered=\"#{result.titleHighlightSnippet != null}\" escape=\"false\"/>\r\n+                                            <h:outputText value=\"#{result.title}\" style=\"padding:4px 0;\"/>\r\n                                             <h:outputText value=\" (#{result.entityId})\" style=\"padding:4px 0;\" rendered=\"#{SearchIncludeFragment.debug == true}\"/></a>\r\n                                         <h:outputText value=\"#{SearchIncludeFragment.DRAFT}\" styleClass=\"label label-primary\" rendered=\"#{result.draftState}\"/>\r\n                                         <h:outputText value=\"#{SearchIncludeFragment.UNPUBLISHED}\" styleClass=\"label label-warning\" rendered=\"#{result.unpublishedState}\"/>\r\nmurphy:dataverse pdurbin$ \r\n```\r\n\r\n## Option 2: Find a better \"fragsize\"\r\n\r\nI also played a bit with setting the \"fragsize\" of the highlight snippets. For example, if you set the fragsize to zero (as in the code below), then **all** the characters in the field that matched are returned, which can be quite long in the case of descriptions. It's the difference between this...\r\n\r\n![world1](https://cloud.githubusercontent.com/assets/21006/8216760/858550e8-1506-11e5-85da-acd5d1be28ad.png)\r\n\r\n... and this (when searching for \"world\"):\r\n\r\n![world2](https://cloud.githubusercontent.com/assets/21006/8216763/9081ca1c-1506-11e5-9c9f-8d5d788dfb60.png)\r\n\r\nSo the question with the second approach is if we could find a fragsize we're happy with. Perhaps this could be a configurable option so we could tweak it runtime until we setting on a value we like. The default fragsize is 100 (the first screenshot above). Here's how it looks with a fragsize of 300:\r\n\r\n![world300](https://cloud.githubusercontent.com/assets/21006/8216852/3cdf7e1c-1507-11e5-9fcb-86a92419b9b9.png)\r\n\r\n```\r\nmurphy:dataverse pdurbin$ git diff src/main/java/edu/harvard/iq/dataverse/SearchServiceBean.java\r\ndiff --git a/src/main/java/edu/harvard/iq/dataverse/SearchServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/SearchServiceBean.java\r\nindex 1b63bbb..d821022 100644\r\n--- a/src/main/java/edu/harvard/iq/dataverse/SearchServiceBean.java\r\n+++ b/src/main/java/edu/harvard/iq/dataverse/SearchServiceBean.java\r\n@@ -89,6 +89,7 @@ public class SearchServiceBean {\r\n //        }\r\n //        solrQuery.setSort(sortClause);\r\n         solrQuery.setHighlight(true).setHighlightSnippets(1);\r\n+        solrQuery.setHighlightFragsize(0);\r\n         solrQuery.setHighlightSimplePre(\"<span class=\\\"search-term-match\\\">\");\r\n         solrQuery.setHighlightSimplePost(\"</span>\");\r\n         Map<String, String> solrFieldsToHightlightOnMap = new HashMap<>();\r\nmurphy:dataverse pdurbin$ \r\n```"}}