indexdata/yaz

Solr query string quoted

MarcoRemy opened this issue · 2 comments

Hi, i am an employee at a larger library. we are handling many different data sources and utilize Pazpar2 for that. Recently i am in charge in optimizing the search results. In the process i discovered an issue which i assume is related to yaz.

In this case the target are solr cores. If a pazpar2 query contains whitespaces the resulting solr query is quoted. Solr treats this as a phrase instead of individual words.

Example Pazpar2 query:
/search.pz2?session=1234567&command=search&query=some%20terms

Resulting Solr query:
/select?defType=lucene&q=%22some%20terms2%22&start=0&rows=20&fl=*

I experimented with different CCL qualifiers without success. Is this behaviour intended or can this considered to be a functional weakness (bug) of yaz in relation to solr queries?

PS: I'm using the latest releases of pazpar2 (1.12.12) and yaz (5.23)

Regards
Nyro

CCL, the language Pazpar2 is using for the query parameter, by default treats terms in order to be a phrase.. And that results in a quoted string in Solr. You should be able to change this by configuring the pz:cclmap:term properly. Use the special structure directive s=al to achive this.. Something like:

<set name="pz:cclmap:term"  value="1=text s=al" />

http://www.indexdata.com/yaz/doc/tools.html#ccl.special.attribute.combos

Hi Adam,

thank you for your kind answer. I can confirm, that your recommended configuration solves the problem.

Resulting Solr query now:
/select?defType=lucene&q=some%20AND%20terms&start=0&rows=20&fl=*

BTW: I would have assumed that (in solr context) the al/ol structure sets the solr query parameter q.op instead of concatenating every single term with operators. However, the result should be the same.

Regards