Daniel-KM / Omeka-S-module-SearchSolr

Search Omeka resources instantly and deeply with Apache Lucene / Solr
Other
3 stars 1 forks source link

Item sets, resource class and resource template filter not working #5

Closed mariusst closed 3 years ago

mariusst commented 4 years ago

If i try to make a search for a keyword and filter the results using either item sets, resource class or resource template filter I get the following errors and no search results:

Query error: Solr HTTP error: OK (400) { "error":{ "metadata":[ "error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.common.SolrException"], "msg":"undefined field item_set_id_field", "code":400}} Query:{ "query": "Aradul nou", "resources": [ "items" ], "is_public": false, "filters": { "item_set_id_field": [ [ "86977", "86995", "87001" ] ] }, "date_range_filters": [], "filter_queries": [], "sort": "dcterms_title_s asc", "offset": 0, "limit": 100, "facet_fields": [ "dcterms_title_s", "dcterms_creator_ss", "dcterms_date_s" ], "facet_limit": 10, "facet_languages": [], "excluded_fields": [], "site_id": 7 }

Query error: Solr HTTP error: OK (400) { "error":{ "metadata":[ "error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.common.SolrException"], "msg":"undefined field resource_class_id_field", "code":400}} Query:{ "query": "Aradul nou", "resources": [ "items" ], "is_public": false, "filters": { "resource_class_id_field": [ [ "bibo:Periodical" ] ] }, "date_range_filters": [], "filter_queries": [], "sort": "dcterms_title_s asc", "offset": 0, "limit": 100, "facet_fields": [ "dcterms_title_s", "dcterms_creator_ss", "dcterms_date_s" ], "facet_limit": 10, "facet_languages": [], "excluded_fields": [], "site_id": 7 }

Query error: Solr HTTP error: OK (400) { "error":{ "metadata":[ "error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.common.SolrException"], "msg":"undefined field resource_template_id_field", "code":400}} Query:{ "query": "Aradul nou", "resources": [ "items" ], "is_public": false, "filters": { "resource_template_id_field": [ [ "10" ] ] }, "date_range_filters": [], "filter_queries": [], "sort": "dcterms_title_s asc", "offset": 0, "limit": 100, "facet_fields": [ "dcterms_title_s", "dcterms_creator_ss", "dcterms_date_s" ], "facet_limit": 10, "facet_languages": [], "excluded_fields": [], "site_id": 7 }

My setup:

Daniel-KM commented 4 years ago

Yes, here the fields are undefined. Can you show me the config of the search page ? Or try to resave it first.

mariusst commented 4 years ago

Here is a screenshot of the config search page Searchconfig

Daniel-KM commented 3 years ago

Indeed, the issues are indicated in the form : the item set id, the resource class id and the template id should be added in fields, so I had the same issue and I added this message in the form because it was simpler to fix in the config of the form than in the module. It will be a future improvement, but for now, it's only a message. So use a form that manages these three fields (even if they are not displayed).

mariusst commented 3 years ago

Daniel, thank you for you answer but I'm not sure if I understood. Are these filters fixable or yet to be implemented? If they are fixable, what do I have to do to add the ids in the fields and what form to use and where?

Daniel-KM commented 3 years ago

No, they are already implemented. In fact, the module Search doesn't know the config of Solr. So you have to include them in the config of Solr: image then choose it in the search form.

The option can be set automatically if you use special form, like the PSL Search Form. In a next version, I'll include them directly in Search to simplify.

mariusst commented 3 years ago

I added the Item set field in Solr config. Then I did a reindex of solr, but still get the same error. If I check the schema in the admin interface of solr I don't see no Item Set field there. Please check the attached screenshots

I'm only interested in Item set filter, but I also set and tested the template and resource class filters and have the same problem

Screenshot from 2020-11-30 11-59-16

Screenshot from 2020-11-30 12-15-00

Screenshot from 2020-11-30 12-23-36