I just gave Solr 4.3 a little whirl (using the example server) with our configs and got a few warnings: it seems the <lib> directives are now resolved relative to the core, not the solr/ directory. Therefore, the libraries aren't found anymore. I don't know how much of an effect this has, though, and what we should do against it. I didn't get any errors during normal usage of the Search API with Solr 4.3, just the two warnings on startup. But I guess at least clustering will be broken, since it doesn't find the clustering libs.
The easiest way out would probably be to just document that Solr 4.3+ users should move/sym-link their contrib/ directories to the appropriate location – one level down to examples/ for the example server. Or we could of course create a new set of configs for 4.3+, but that would surely be overkill. Or, I don't know, maybe there are other options?

In any case, it should be discussed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

giorgio79’s picture

I am using Solr 4.3 and Search API Solr without any issues. I placed the 4x config files in .../solr-4.3.0/example/solr/collection1/conf and everything is cool. :)

drunken monkey’s picture

Really, you get no warnings at all on startup?

giorgio79’s picture

FileSize
15.36 KB

Yep, flying like a rocket :D Attaching startup output.

drunken monkey’s picture

1539 [coreLoadExecutor-3-thread-1] WARN  org.apache.solr.core.SolrResourceLoader  – Can't find (or read) directory to add to classloader: ../../contrib/extraction/lib (resolved as: /root/solr-4.3.0/example/solr/collection1/../../contrib/extraction/lib).

That's exactly what I was talking about – this will still work for normal use cases, but will probably fail if you try to use clustering or extraction (I presume).

However, as these are admittedly advanced use cases, documenting this incompatibility should probably be sufficient.

Owen Barton’s picture

I also get the error reported in #2011448: Solr 4.3- Error SolrCore: java.lang.IllegalArgumentException: NumericTokenStream does not support CharTermAttribute - "org.apache.solr.common.SolrException: Unexpected character 't' (code 116) excepted space, or '>' or "/>". I only appear to get this on cron, however and index, search, facets and (non-term) MLT functionality all seems to be working fine. Any ideas?

drunken monkey’s picture

I think that should be discussed in a new issue for the module you're using, at first glance it doesn't seem to relate to the configs.

Owen Barton’s picture

Thanks for taking a look! I upgraded Search API and this doesn't seem to be occurring any more. If I can reproduce I'll open a new issue.

justluvgod’s picture

FileSize
38.98 KB

I just installed SOLR 4.4 and was getting the error drunken monkey has mentioned. I did move the contrib file to the example folder and the errors are now gone.

Curious though, also under the logging tab there is a "spinning wheel" next to last check that continuously spins. Seems like it is looking for something still but I cant be certain.

Is everything all good or is there some underlying issue that I should be mindful? I have included a screenshot.

drunken monkey’s picture

It's the same for me (on 4.2), too. I don't know what it means, but I wouldn't worry about that. As long as no warnings or errors are logged, things should be fine.

justluvgod’s picture

thanks

HeathN’s picture

The spinning icon is normal, that just means it is constantly looking for new logs. I moved the contrib directory into my example folder and no negative logs come up as well. This seems to be the solution. Is this a bug in Apache Solr or the Drupal module?

For the record I am using Apache Solr 4.4 and this problem still exists.

drunken monkey’s picture

Is this a bug in Apache Solr or the Drupal module?

Neither, it's not a bug at all. Apache Solr 4.3+ just expects this directory in a different location than it did up to 4.2 – so if we don't want to have two sets of configuration files just for this single difference, there's no way around requiring users of either 4.0–4.2 or 4.3+ to move that directory themselves.
At least none that I could think of – that's what this issue is here for.

Andre-B’s picture

I have no idea where to post this but Ill do it here:

I just tried setting up search_api + solr for a solr 4.5 server, and had to do some manual patching for the files #2107417: Multiple values in solrconfig.xml cause error with solr 4.5+, since I do not know about compatibility issues with other versions than 4.5 I am wondering why there isnt simply a 4.1, 4.2, 4.3, 4.4 and/ or 4.5 config file, rather than trying to serve all version from one 4.x file?

drunken monkey’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
663 bytes

OK, it seems we got it all backwards. Actually, Solr 4.3 just changed error reporting for missing lib directories. The directories are actually invalid in Solr 4.0 – 4.2, too – it just ignores them silently instead of issuing a warning.
So, the fix is to just correct the directory, for all Solr 4 versions. Patch attached.

drunken monkey’s picture

Of course, this will then just be fixed for the example installation. On a custom setup, the contrib folder could be anywhere, or not even present at all. Maybe we should make the path configurable in the properties file, too? Thinking about it, hardcoding doesn't make that much sense and it goes against our usual method of making everything that users should reasonably be able to change easily configurable. If the user doesn't want to modify our provided solrconfig.xml (which is the smart way, of course), they'd have to adapt the directory structure of their installation to the config files (if they want to use extraction or clustering, or avoid warnings).

Also, users currently cannot add their own lib directories without modifying solrconfig.xml directly: see #2145969: solrconfig_extra.xml not working as it should. However, this is mitigated by the fact that they can just put a lib/ directory into the core's root directory.

Nick_vh’s picture

Making this configurable makes sense so let's proceed with that! Solrconfig_extra was more meant for adding spellchecker and some other more common edits.

drunken monkey’s picture

Title: What to do about Solr 4.3 incompatibility? » Fix wrong path to contrib dir in 4.x
Category: Task » Bug report
FileSize
1.03 KB

OK, here's a patch with a new solr.contrib.dir property added.

Nick_vh’s picture

FileSize
2.08 KB
Nick_vh’s picture

So I made this change also in the 3.x branch of solr. As it doesn't bring any new change with it, I'm committing this

Nick_vh’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.