Class: Hyrax::SolrQueryBuilderService Deprecated
- Inherits:
-
Object
- Object
- Hyrax::SolrQueryBuilderService
- Defined in:
- app/services/hyrax/solr_query_builder_service.rb
Overview
Deprecated.
This class is being replaced by Hyrax::SolrQueryService.
Methods in this class are from/based on ActiveFedora::SolrQueryBuilder
Class Method Summary collapse
- .construct_query(field_pairs, join_with = default_join_with, type = 'field') ⇒ String deprecated Deprecated.
- .construct_query_for_ids(id_array) ⇒ String deprecated Deprecated.
- .construct_query_for_model(model, field_pairs, join_with = default_join_with, type = 'field') ⇒ String deprecated Deprecated.
- .default_join_with ⇒ Object deprecated Deprecated.
Class Method Details
.construct_query(field_pairs, join_with = default_join_with, type = 'field') ⇒ String
Deprecated.
Construct a solr query from a list of pairs (e.g. [field name, values])
38 39 40 41 42 43 44 |
# File 'app/services/hyrax/solr_query_builder_service.rb', line 38 def construct_query(field_pairs, join_with = default_join_with, type = 'field') Deprecation.warn("'##{__method__}' will be removed in Hyrax 4.0. " \ "Instead, use 'Hyrax::SolrQueryService.new.with_field_pairs'.") Hyrax::SolrQueryService.new.with_field_pairs(field_pairs: field_pairs, join_with: join_with, type: type).build end |
.construct_query_for_ids(id_array) ⇒ String
Deprecated.
Construct a solr query for a list of ids This is used to get a solr response based on the list of ids in an object’s RELS-EXT relationhsips If the id_array is empty, defaults to a query of “id:NEVER_USE_THIS_ID”, which will return an empty solr response
21 22 23 24 25 26 27 |
# File 'app/services/hyrax/solr_query_builder_service.rb', line 21 def construct_query_for_ids(id_array) Deprecation.warn("'##{__method__}' will be removed in Hyrax 4.0. " \ "Instead, use 'Hyrax::SolrQueryService.new.with_ids'.") ids = id_array.reject(&:blank?) return "id:NEVER_USE_THIS_ID" if ids.empty? Hyrax::SolrQueryService.new.with_ids(ids: id_array).build end |
.construct_query_for_model(model, field_pairs, join_with = default_join_with, type = 'field') ⇒ String
Deprecated.
Construct a solr query from a list of pairs (e.g. [field name, values]) including the model (e.g. Collection, Monograph)
63 64 65 66 67 68 69 70 |
# File 'app/services/hyrax/solr_query_builder_service.rb', line 63 def construct_query_for_model(model, field_pairs, join_with = default_join_with, type = 'field') Deprecation.warn("'##{__method__}' will be removed in Hyrax 4.0. " \ "Instead, use 'Hyrax::SolrQueryService.new.with_model'.") field_pairs["has_model_ssim"] = model.to_s Hyrax::SolrQueryService.new.with_field_pairs(field_pairs: field_pairs, join_with: join_with, type: type).build end |
.default_join_with ⇒ Object
Deprecated.
47 48 49 50 51 |
# File 'app/services/hyrax/solr_query_builder_service.rb', line 47 def default_join_with Deprecation.warn("'##{__method__}' will be removed in Hyrax 4.0. " \ "There will not be a replacement for this method. See Hyrax::SolrQueryService which is replacing this class.") ' AND ' end |