ojsde / lucene

Plugin for Solr/Lucene support in OJS.
GNU General Public License v2.0
0 stars 8 forks source link

Query string to Solr with array values #21

Open mathiasv27 opened 1 year ago

mathiasv27 commented 1 year ago

Hi, There is a problem with the query string sent to Solr, specifically with the fq parameter. It was revealed on our OJS multiple journal instance: the search engine displays articles regardless of which journal they come from. The request sent to Solr looks like this: :

params={mm=1&facet.field[1]=subject_fr_FR_facet&facet.range=publicationDate_dt&facet.field[0]=discipline_fr_FR_facet&df=authors_txt+title_de_DE+title_en_US+title_es_ES+title_it_IT+title_pt_PT+abstract_de_DE+abstract_en_US+abstract_es_ES+abstract_it_IT+abstract_pt_PT+discipline_en_US+subject_en_US+type_en_US+coverage_en_US&facet.range.gap=%2B1YEAR&facet.range.other=all&hl=on&facet.field[4]=authors_facet&facet.field[3]=coverage_fr_FR_facet&facet.field[2]=type_fr_FR_facet&start=0&sort=score+desc&rows=25&fq[1]=journal_id:"localhost-7"&fq[0]=inst_id:"localhost"&q=bordeaux&defType=edismax&qf=authors_txt+title_de_DE+title_en_US+title_es_ES+title_it_IT+title_pt_PT+abstract_de_DE+abstract_en_US+abstract_es_ES+abstract_it_IT+abstract_pt_PT+discipline_en_US+subject_en_US+type_en_US+coverage_en_US&spellcheck=on&hl.fl=abstract_de_DE+abstract_en_US+abstract_es_ES+abstract_it_IT+abstract_pt_PT&facet=on&facet.range.start=NOW/YEAR-50YEARS&facet.range.end=NOW}

The parameters query with [0] , [1], ... is not recognized by Solr : arrays must be sent as a repetition of the parameter, such as ...&fq=journal_id:"localhost-7"&fq=inst_id:"localhost" (https://solr.apache.org/guide/solr/latest/query-guide/common-query-parameters.html#fq-filter-query-parameter)

I'll work on a fix and submit a pull request if you don't mind.

Mathias

ronste commented 1 year ago

Hi @mathiasv27 ,

thanks for your report. As stated in the Readme the OJS Lucence plugin is now maintained by PKP at https://github.com/pkp/lucene.

If you installed it from the PKP Plugin Gallery please post your report there. If you use an older version from this repo I would advise you to switch/upgrade to the plugin version from the plugin gallery. Maybe the problem was solved already.

Best wishes, Ronald