fts_solr and # char
Hi,
Dovecot wiki says the solr url is something like 'solr/dovecot/' but this gives a 404, if I install solr as per the docs I have a 'solr/#/dovecot/' url:
https://wiki.dovecot.org/Plugins/FTS/Solr
I have installed dovecot 2.3 from https://repo.dovecot.org/ and solr 8.3 as per the wiki on a Ubuntu 18.04.
The problem and the guess work I did:
fts_solr = url=http://localhost:8983/solr/#/dovecot/
doveconf: Warning: Configuration file /etc/dovecot/conf.d/90-plugin.conf line 13: Ambiguous '#' character in line, treating it as comment. Add a space before it to remove this warning.
fts_solr = url="http://localhost:8983/solr/#/dovecot/"
Error: fts: Failed to initialize backend 'solr': fts_solr: Failed to parse HTTP url: Path component contains invalid character
fts_solr = url='http://localhost:8983/solr/#/dovecot/'
Error: fts: Failed to initialize backend 'solr': fts_solr: Failed to parse HTTP url: Relative HTTP URL not allowed
fts_solr = url=http://localhost:8983/solr/%23/dovecot/
Error: Failed to expand plugin setting fts_solr = 'url=http://localhost:8983/solr/%23/dovecot/': Unknown variable '%/'
fts_solr = 'url=http://localhost:8983/solr/#/dovecot/'
fts_solr: Failed to parse HTTP url: URL fragment not allowed for HTTP URL in this context
Thanks for any help.
-- *Marcio Merlone=*
On 12/2/2019 12:34 PM, Marcio Merlone via dovecot wrote:
Dovecot wiki says the solr url is something like 'solr/dovecot/' but this gives a 404, if I install solr as per the docs I have a 'solr/#/dovecot/' url:
Solr URLs with # in them are ONLY for use in a browser. You cannot use them for API calls. Specifically, they are used by the complex javascript application that is the Solr admin UI.
The reason is that all characters in a URL starting with # are NOT sent to the server, they are ONLY handled by the client. Typically only a browser is capable of using those characters.
If the Solr core/collection is named "dovecot" then the example URL in the wiki is completely correct. If the index has a different name, then you can replace the string "dovecot" with the correct name.
Trying the exact URL that you give to dovecot *will* give you a 404 error. When a Solr client (like fts_solr) uses that URL, it will add the necessary information for it to work correctly.
Thanks, Shawn
participants (2)
-
Marcio Merlone
-
Shawn Heisey