Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5584 Filtering of Files on Dataset Page, Search using Solr #5820

Merged
merged 24 commits into from May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d8b07d3
Added static placeholders for file table facets on dataset pg [ref #5…
mheppler Apr 1, 2019
4d230a6
Merge branch 'develop' into 5584-dataset-solr-facets
mheppler Apr 17, 2019
3cea482
Minor layout cleanup of facets above file table on dataset pg [ref #5…
mheppler Apr 17, 2019
f3a9c24
Merge branch 'develop' into 5584-dataset-solr-facets
landreev Apr 30, 2019
b58d296
Checking a few bits and pieces that are already working.
landreev May 6, 2019
e0793c1
improved logic for indexed vs. non-indexed version. (#5584)
landreev May 6, 2019
eb16aa3
logic for passing the file search parameter to the page. (#5584)
landreev May 6, 2019
7d483e6
A version with working facets. (#5584)
landreev May 7, 2019
e6b8df2
Merge branch 'develop' into 5584-dataset-solr-facets
landreev May 8, 2019
603097c
some index improvements for file searching;
landreev May 9, 2019
4deead9
the experimental new indexed field, a boolean flag for a published fi…
landreev May 9, 2019
4923f32
Reorganized UI above files table to give facets more space, moved tex…
mheppler May 10, 2019
63e34fc
fixed the rendering rule to show the search button for a non-indexed …
landreev May 13, 2019
fbc4e71
wiring for the sort button in the xhtml (#5584)
landreev May 13, 2019
af34691
file sort implementation (#5584)
landreev May 13, 2019
bf0d5e6
Added a section to the user guide, documenting the new file search fu…
landreev May 14, 2019
60e75f3
Fixed responsive and dynamic layout issues with Sort btn and file met…
mheppler May 15, 2019
358ad66
Merge branch 'develop' into 5584-dataset-solr-facets
landreev May 15, 2019
de0fae9
toned down the logging messages; removed and/or rewrote some comments…
landreev May 16, 2019
2d88761
release note for the issue. (#5584)
landreev May 16, 2019
69405e4
changed some rendering rules to differentiate between the "no files i…
landreev May 20, 2019
b92774e
fixed the backward compatibility check (for the old solr schema) (#5584)
landreev May 20, 2019
0846c8f
Updated msg for no results found in files table on dataset, moved to …
mheppler May 21, 2019
78def13
Merge branch 'develop' into 5584-dataset-solr-facets
landreev May 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/solr/7.3.1/schema.xml
Expand Up @@ -145,6 +145,7 @@
<field name="dvObjectType" type="string" stored="true" indexed="true" multiValued="false"/>
<field name="metadataSource" type="string" stored="true" indexed="true" multiValued="false"/>
<field name="isHarvested" type="boolean" stored="true" indexed="true" multiValued="false"/>
<field name="fileDeleted" type="boolean" stored="true" indexed="true" multiValued="false"/>

<field name="dvName" type="text_en" stored="true" indexed="true" multiValued="false"/>
<field name="dvAlias" type="text_en" stored="true" indexed="true" multiValued="false"/>
Expand Down
1 change: 1 addition & 0 deletions doc/release-notes/5584-dataset-page-solr.md
@@ -0,0 +1 @@
* Improved search on files within a dataset plus search facets are added to the dataset page. A solr schema upgrade and a full reindex are required to fully take advantage of this functionality.
22 changes: 22 additions & 0 deletions doc/sphinx-guides/source/user/find-use-data.rst
Expand Up @@ -64,6 +64,22 @@ View Files

Files in Dataverse each have their own page that can be reached through the search results or through the Files table on their parent dataset's page. The dataset page and file page offer much the same functionality in terms of viewing and editing files, with a few small exceptions. The file page includes the file's persistent identifier (DOI or handle), which can be found under the Metadata tab. Also, the file page's Versions tab gives you a version history that is more focused on the individual file rather than the dataset as a whole.

File Search within Datasets
---------------------------

In addition to searching for files from the Home Page and indidvidual dataverse pages, users can run searches on files within individual datasets. A search form is provided on the Dataset page, at the top of the Files view. For the latest published version, and the draft of a dataset (if exists), search facets are also provided, for selecting files based on file type, tags and access restrictions (see the example below).

|image-file-search-facets|

(To provide the search facets, we rely on the Solr search engine. Only the latest published, and the draft versions of datasets are indexed in Solr. Because of that facets cannot be offered for the older versions.

Tree View
---------

Files can be organized in one or more folders (directories) within a dataset. If the folder structure is defined, the Dataset Page will present an option for switching between the traditional table view, and the tree-like view of the files, as in the example below:

|image-file-tree-view|

Cite Data
---------

Expand Down Expand Up @@ -129,3 +145,9 @@ Explore Data
------------

Please see the :doc:`/user/data-exploration/index`.

.. |image-file-tree-view| image:: ./img/file-tree-view.png
:class: img-responsive
.. |image-file-search-facets| image:: ./img/file-search-facets.png
:class: img-responsive

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DataFileServiceBean.java
Expand Up @@ -284,7 +284,23 @@ public List<Integer> findFileMetadataIdsByDatasetVersionIdLabelSearchTerm(Long d
+ " order by o." + sortField + " " + sortOrder)
.getResultList();
}

public List<Long> findDataFileIdsByDatasetVersionIdLabelSearchTerm(Long datasetVersionId, String searchTerm, String userSuppliedSortField, String userSuppliedSortOrder){
FileSortFieldAndOrder sortFieldAndOrder = new FileSortFieldAndOrder(userSuppliedSortField, userSuppliedSortOrder);

searchTerm=searchTerm.trim();
String sortField = sortFieldAndOrder.getSortField();
String sortOrder = sortFieldAndOrder.getSortOrder();
String searchClause = "";
if(searchTerm != null && !searchTerm.isEmpty()){
searchClause = " and (lower(o.label) like '%" + searchTerm.toLowerCase() + "%' or lower(o.description) like '%" + searchTerm.toLowerCase() + "%')";
}

return em.createNativeQuery("select o.datafile_id from FileMetadata o where o.datasetVersion_id = " + datasetVersionId
+ searchClause
+ " order by o." + sortField + " " + sortOrder)
.getResultList();
}

public List<FileMetadata> findFileMetadataByDatasetVersionIdLazy(Long datasetVersionId, int maxResults, String userSuppliedSortField, String userSuppliedSortOrder, int firstResult) {
FileSortFieldAndOrder sortFieldAndOrder = new FileSortFieldAndOrder(userSuppliedSortField, userSuppliedSortOrder);
Expand Down