You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solr query builder service will be more functional if it can build up queries across several methods (e.g. include list of ids, limit to model, and attr-value pairs) instead of creating a single query complete query for each method. This will facilitate creation of more complex queries.
Rationale
There is a need to build up queries instead of executing a simple query and then filter the results.
Proposed Design
Rename Class
To recognize that the service does more than construct queries, it is being renamed from Hyrax::SolrQueryBuilderService to Hyrax::SolrQueryService. Hyrax::SolrQueryBuilderService and its methods are being deprecated.
NOTE: SolrQueryBuilderService uses class methods. The refactored SolrQueryService uses instance methods. This allows the query to be built up within the instance.
[
'{!terms f=id}id1,id2',
'_query_:"{!field f=has_model_ssim}Monograph"',
'(_query_:"{!field f=generic_type_sim}Work" OR _query_:"{!field f=generic_type_si}Work")',
'(_query_:"{!field f=library_id_ssim}123" AND _query_:"{!field f=owner_ssim}Fred")'
'(_query_:"{!field f=subject_id_ssim}Science" OR _query_:"{!field f=subject_ssim}Philosophy")'
]
Building process: each component is joined using ' AND '
Results:
"{!terms f=id}id1,id2 AND " \
"_query_:\"{!field f=has_model_ssim}Monograph\" AND " \
"(_query_:\"{!field f=generic_type_sim}Work\" OR _query_:\"{!field f=generic_type_si}Work\") AND " \
"(_query_:\"{!field f=library_id_ssim}123\" AND _query_:\"{!field f=owner_ssim}Fred\") AND " \
"(_query_:\"{!field f=subject_id_ssim}Science\" OR _query_:\"{!field f=subject_ssim}Philosophy\")"
Related work
PR #4929 replace AF.where in dashboard_helper_behavior
PR #4910 replace ActiveFedora where with Valkyrized where
The text was updated successfully, but these errors were encountered:
Descriptive summary
The solr query builder service will be more functional if it can build up queries across several methods (e.g. include list of ids, limit to model, and attr-value pairs) instead of creating a single query complete query for each method. This will facilitate creation of more complex queries.
Rationale
There is a need to build up queries instead of executing a simple query and then filter the results.
Proposed Design
Rename Class
To recognize that the service does more than construct queries, it is being renamed from
Hyrax::SolrQueryBuilderService
toHyrax::SolrQueryService
.Hyrax::SolrQueryBuilderService
and its methods are being deprecated.NOTE: SolrQueryBuilderService uses class methods. The refactored SolrQueryService uses instance methods. This allows the query to be built up within the instance.
attr_reader :query, :solr_service
Rename Methods that Generate Query Snippets
Methods are being renamed as follows...
'{!terms f=id}id1,id2'
'_query_:"{!field f=has_model_ssim}Monograph"'
'(_query_:"{!field f=generic_type_sim}Work" OR _query_:"{!field f=generic_type_si}Work")'
'(_query_:"{!field f=library_id_ssim}123" AND _query_:"{!field f=owner_ssim}Fred")'
Methods that Submit Queries
Building the Query
Example Query array:
Building process: each component is joined using
' AND '
Results:
Related work
PR #4929 replace AF.where in dashboard_helper_behavior
PR #4910 replace ActiveFedora where with Valkyrized where
The text was updated successfully, but these errors were encountered: