Closed (fixed)
Project:
Search API Solr
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 May 2013 at 15:59 UTC
Updated:
10 Sep 2015 at 17:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
drunken monkeyPatch attached. It simply doesn't add integer, float and date fields to the
mlt.flparameter.Comment #2
drunken monkeyAdded a note to the README.txt and committed.
However, I'm setting this back to "active" as we should probably find a better solution for this. After all, taxonomy terms are usually one of the major sources for MLT queries, and since they are indexed as integers they won't be available anymore for Solr 4 now.
One way to do this would be to add a setting to the server, which would automatically add string versions of all indexed integer, float and date values to the Solr index, and then replace the field prefix accordingly if a MLT query uses these fields.
Other ideas would also be welcome.
Comment #3
drunken monkeyComment #4
owen barton commentedOne workaround that I just used that (I think!) is working is to add a specific MLT aggregate field to the index, and add the taxonomy (and other high signal) fields to that.
Comment #5
drunken monkeyThe Apache Solr issue seems to be "won't fix", as – according to the most recent comment a few days ago – this is a Lucene limitation now. Therefore, I guess the only thing we could think about is to implement such a workaround directly in our module. I.e., index copies of all integer, float and date fields as strings or other data types that work. We could also make this a server option, so only people who want to use MLT would have the (minor) overhead.
Comment #6
rattusrattus commentedI'm using the approach outlined in #4 and it seems to be working here though it is an effort to have to duplicate all term fields as compound fields.
Comment #7
danielstrum commentedHi Folks,
Thanks for the great module. I have just moved a site and am now forced to use Solr 4. Are there any plans to fox this so that MLT works with Solr4?
Thanks in advance.
Comment #8
drunken monkeyAs outlined, it wouldn't be too difficult to add a workaround for this problem to the module. However, I currently don't have any time for working (unpaid) on D7 features (or minor bugs such as this), with the D8 port taking up most of my free time and my D7 modules only receiving important bug fixes (or features others develop).
So, if you want this, you'll either have to code it yourself or pay someone to do it for you. I'd definitely review a patch, if provided.
Comment #9
danielstrum commentedHi dm... I should have added a comment here. I got this working using the latest dev version and the patch I found here:
https://www.drupal.org/node/1868434
Thanks for your response.
Comment #10
BarisW commentedIt seems that the patch in #1 already has been committed. However, this makes that matching content on terms doesn't work anymore. I'm not sure why this has been added, because matching on term id's works perfectly fine in Solr 4.x
For my project I 'fixed' it with the following piece of code, but I think this should be fixed in Search API Solr instead.
Comment #11
drunken monkeyHuh, you're (partially) right, it really seems they've fixed that now. It's definitely broken in 4.0.0, though, so we can't just remove the workaround. However, you can just manually set the Solr version number to 5.x in the Search API server settings – that should have no effect other than removing that workaround.
It seems it was fixed in this issue, since it starts working with versions higher than Solr 4.6.0. So as a general "solution", we can probably just check more closely for only the versions affected.
Also, while checking for this bug, I found out that Solr 5.x now throws a
NullPointerExceptionif you try to activate facets in an MLT request. So there's yet another Solr bug we have to work around.I've also created a Solr issue for it.
Patch for both of these attached, please test!
Comment #12
drunken monkeyCommitted.