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

Hide custom terms from resource forms #359

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/metadata/child_works_from_pdf_splitting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ attributes:
multiple: false
index_keys:
- "is_child_bsi"
form:
Copy link
Contributor

@ShanaLMoore ShanaLMoore Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if adding this back will set is_child to false again, instead of nil. cc @laritakr

we need is_child to be true or nil. The catalog query filters out anything that's nil.

if it must be false, I suppose we could update the query but I wonder why it was never set to false from the original implementation.

Copy link
Contributor

@ShanaLMoore ShanaLMoore Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also ideally we won't update the query because existing applications would need to set their nils to false which may require their data to be reindexed. Unless the query can filter out both 🤔

Copy link
Contributor

@ShanaLMoore ShanaLMoore Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps something like the following will work (untested). I'm not sure how to write a filter query for NOT is_child:true

def show_parents_only(solr_parameters)
  query = if blacklight_params["include_child_works"] == 'true'
            IiifPrint.solr_construct_query(is_child_bsi: 'true')
          else
            "-_query_:\"{!field f=is_child_bsi}true\"" 
          end
  solr_parameters[:fq] += [query]
end

Copy link
Contributor Author

@laritakr laritakr Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The term is not present on the parent, so it is nil.
On the child, it is true as expected.
The child works are once again hidden from the catalog search.

Screenshot 2024-06-20 at 3 14 17 PM

Screenshot 2024-06-20 at 3 14 45 PM

Screenshot 2024-06-20 at 3 15 14 PM
be6)

display: false
required: false
primary: false
multiple: false
predicate: "http://id.loc.gov/vocabulary/identifiers/isChild"
split_from_pdf_id:
type: string
multiple: false
index_keys:
- "split_from_pdf_id_ssi"
form:
display: false
required: false
primary: false
multiple: false
Expand Down
Loading