Re: FTS Solr errors using doveadm

2018-06-29 Thread Aki Tuomi


> On 30 June 2018 at 05:54 Stuart Henderson  wrote:
> 
> 
> On 2018-06-07, Ricardo Branco  wrote:
> > Solr 7 returns JSON by default but fts_solr requires XML.
> >
> > Would be good to have wt=xml added to the query to force it to xml all the 
> > time, this would prevent errors if solr has 
> > not had xml set as default for index.
> 
> This is already done in Dovecot 2.3.x, the same patch works in 2.2.x.
> 
> https://github.com/dovecot/core/commit/f987ef0632fc.patch
> 
>

You can also configure SOLR to use XML instead of JSON by default.

Aki


Re: FTS Solr errors using doveadm

2018-06-29 Thread Stuart Henderson
On 2018-06-07, Ricardo Branco  wrote:
> Solr 7 returns JSON by default but fts_solr requires XML.
>
> Would be good to have wt=xml added to the query to force it to xml all the 
> time, this would prevent errors if solr has 
> not had xml set as default for index.

This is already done in Dovecot 2.3.x, the same patch works in 2.2.x.

https://github.com/dovecot/core/commit/f987ef0632fc.patch




Re: FTS Solr errors using doveadm

2018-06-11 Thread Aki Tuomi


On 07.06.2018 17:35, Ricardo Branco wrote:
>
> Solr 7 returns JSON by default but fts_solr requires XML.
>
> Would be good to have wt=xml added to the query to force it to xml all
> the time, this would prevent errors if solr has not had xml set as
> default for index.
>
>
> Dovecot 2.2.36
> Centos 6
>
> *Doveadm Request:*
>
> doveadm search -u carol...@covermg.com TEXT smith
>
> doveadm(carol...@covermg.com): Error: fts_solr: Invalid XML input at
> 1:0: not well-formed (invalid token) (near: {
>   "responseHeader":{
>     "status":0,
>     "QTime":0,
>     "params":{
>   "q":"{!lucene q.op=AND}(hdr:smith OR body:smith)",
>   )
> doveadm(carol...@covermg.com): Error: fts_solr: Invalid XML input at
> 1:0: not well-formed (invalid token) (near: {
>   "responseHeader":{
>     "status":0,
>     "QTime":0,
>     "params":{
>   "q":"box:1065b22d6b02185bd40fd09efc50 AND user:ca)
>
>
> *TCP Dump*
>
> Content-Type: application/json;charset=utf-8
> Content-Length: 329
>
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":1,
>     "params":{
>   "q":"{!lucene q.op=AND}from:smith",
>   "fl":"uid,score",
>   "sort":"uid asc",
>   "fq":"+box:b571472154d7035b4e25d09efc50
> +user:carol...@covermg.com",
>   "rows":"69235"}},
>   "response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[]
>   }}
>

Thanks for reporting this.

Aki


FTS Solr errors using doveadm

2018-06-07 Thread Ricardo Branco

Solr 7 returns JSON by default but fts_solr requires XML.

Would be good to have wt=xml added to the query to force it to xml all the time, this would prevent errors if solr has 
not had xml set as default for index.



Dovecot 2.2.36
Centos 6

*Doveadm Request:*

doveadm search -u carol...@covermg.com TEXT smith

doveadm(carol...@covermg.com): Error: fts_solr: Invalid XML input at 1:0: not 
well-formed (invalid token) (near: {
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
  "q":"{!lucene q.op=AND}(hdr:smith OR body:smith)",
  )
doveadm(carol...@covermg.com): Error: fts_solr: Invalid XML input at 1:0: not 
well-formed (invalid token) (near: {
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
  "q":"box:1065b22d6b02185bd40fd09efc50 AND user:ca)


*TCP Dump*

Content-Type: application/json;charset=utf-8
Content-Length: 329

{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
  "q":"{!lucene q.op=AND}from:smith",
  "fl":"uid,score",
  "sort":"uid asc",
  "fq":"+box:b571472154d7035b4e25d09efc50 +user:carol...@covermg.com",
  "rows":"69235"}},
  "response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[]
  }}