[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14734908#comment-14734908 ] ASF subversion and git services commented on LUCENE-6774: - Commit 1701811 from [~thetaphi] in branch 'dev/branches/lucene_solr_5_3' [ https://svn.apache.org/r1701811 ] Backport: LUCENE-6774: Remove classloader hack in MorfologikFilter > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727741#comment-14727741 ] Uwe Schindler commented on LUCENE-6774: --- URI -> URL (like returned by Class#getResource()). URI does not supply InputStreams. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727478#comment-14727478 ] ASF subversion and git services commented on LUCENE-6774: - Commit 1700839 from [~rcmuir] in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1700839 ] LUCENE-6774: Remove solr hack in MorfologikFilter > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727500#comment-14727500 ] Yonik Seeley commented on LUCENE-6774: -- If it did break Solr, then we should have come up with a solution that works for *everyone*. Removing that code without even *knowing* if it broke solr is essentially giving us all the middle finger. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727738#comment-14727738 ] Dawid Weiss commented on LUCENE-6774: - You see Morfologik does ship with the Polish dictionary, but it's merely a simply wrapper around a static inflection dictionary. You could build these yourself for an arbitrary language and reuse all of the code to just load and scan it -- this is what this project does, for example: https://languagetool.org/ That's why I think it'd make more sense to remove all of these resource-loading facilities and simply require an URI to the data itself. Your solution is great, of course! > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727503#comment-14727503 ] Uwe Schindler commented on LUCENE-6774: --- [~ysee...@gmail.com]: I'd suggest to write a test, which is not so easy for analysis extras. From looking at the code I see no reason why Morphologik's code may not find the files. I think this might have been fixed by Dawid to no longer solely depend on context classloader. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727699#comment-14727699 ] Dawid Weiss commented on LUCENE-6774: - I think an URI would be most flexible. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727600#comment-14727600 ] Uwe Schindler commented on LUCENE-6774: --- My proposal: - we should load the resource using local path (it is very simple, its just the language name) - [~dweiss] should maybe fix this in morphologik, the code is still broken. Maybe he should remove the whole class (he has a nocommit there) I'll supply a patch for a solution that always works not dealing with context classloader. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727669#comment-14727669 ] Dawid Weiss commented on LUCENE-6774: - I will fix this in Morfologik so that dictionaries are not looked up via class resource search mechanism. The reason context class loader was used was not just Solr -- it was also a workaround for certain web servlet containers (as far as I can remember). I am working on a proper fix in Morfologik, which I'll then apply to Lucene/ Solr. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727488#comment-14727488 ] Uwe Schindler commented on LUCENE-6774: --- I linked the issue that causes the havoc here. I don't think this is an issue anymore, because morphologik tries: # context classloader # own classloader # system classloader (in this order). I am not sure how this was implemented in the version used in SOLR-4007. Maybe [~dawid.weiss] knows more. I have he feeling that this is no issue anymore. We should add a test for Solr. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727490#comment-14727490 ] Yonik Seeley commented on LUCENE-6774: -- Hmmm, you essentially reverted SOLR-4007 Is that code no longer necessary, or will the error that SOLR-4007 resolved now happen again? I know SOLR-4007 didn't add a test (and maybe it's hard to do), but that's no reason to knowingly break Solr. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727533#comment-14727533 ] Yonik Seeley commented on LUCENE-6774: -- Setting as a blocker until someone can determine if Solr is now broken or not. Hopefully Uwe is right and the code is no longer needed. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727498#comment-14727498 ] Robert Muir commented on LUCENE-6774: - this horrible hack prevents the analyzer from being used in other environments. sorry, solr can set contextclassloader in its own code. Doing it here is no reason to break *other non-solr apps* Believe it or not, there are people that use lucene without solr. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727509#comment-14727509 ] Robert Muir commented on LUCENE-6774: - I don't care if i broke solr. solr can fix itself here instead of breaking everyone else. its just that simple. lucene is a library. if you think i'm giving solr the middle finger, then well, fine, it deserves it: {noformat} ../´¯/) ,/¯../ ...// ./´¯/'...'/´¯¯`·¸ ../'/...//.../¨¯\ ('(...´...´ ¯~/'...') .\.'./ ..''...\.. _.·´ \..( ..\.\... {noformat} > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727594#comment-14727594 ] Uwe Schindler commented on LUCENE-6774: --- Hi, I checked the code after a beer and now I know what the issue is. In fact the ResourceUtils code did not change since Solr 4.0 where SOLR-4007 was reported on. This was using version 1.5.5 of Morphologik. The problem is very simple: # Morphologic tries context class loader first, obviously this fails for Solr (SOLR-3716) # As a second try it does "the right thing" but obviously wrong: It uses ResourceUtil.class.getResourceAsStream(), and this fails because when loading the resource it uses an absolute path inclusive package, but without a slash. This of course fails, because the file is not found. This causes Solr fail. # Finally it tries the system classloader. Of course the resource isn't there, because the system classloader has The issue here is the stupid java difference: If you use a Classloader, you don't need leading slash. If you use Class#getResource() it resolves against current package, so you need a leading slash, if you want it with an absolute path. In single classloader applications this is no issue, because the context classloader always works, but not in Solr. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727676#comment-14727676 ] Uwe Schindler commented on LUCENE-6774: --- Dawid: I think the quickest fix would be to replace the second try to add a leading slash in ResourceUtils. For now, we prefer to have the dictionary loaded statically. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727674#comment-14727674 ] Dawid Weiss commented on LUCENE-6774: - Thanks Uwe, yep, it looks good to me as a temporary workaround. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727682#comment-14727682 ] Uwe Schindler commented on LUCENE-6774: --- Maybe add a method with a classloader. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727730#comment-14727730 ] Uwe Schindler commented on LUCENE-6774: --- OK or URI. I think the current Lucene code is not really a "workaround" we can keep it as is. It does not hack anything it just uses the official APIs. The only thing thats a hack is the hardcoded package paths. Maybe add those as constants to Morfologik. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727515#comment-14727515 ] Uwe Schindler commented on LUCENE-6774: --- Setting a context class loader inside "library" code is a big problem and should never ever done. It is good that Robert found this problem. The code has to be removed, sorry. Please let us fix the code by: # first adding a test # ask [~dweiss] if there were changes he did after this issue in Morphlogik's resource loading If both of this does not work would suggest to: # let Solr set the context ClassLoader: SOLR-3716 # just load the resource files ourselves and pass them to Dictionary#load(). This is mainly because I am not happy that Morfologik uses context ClassLoader at all. So I would like to fix this by loading the file ourselves from Class's classpath (or in the factory using ResourceLoader as provided by Lucene/Solr). > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727681#comment-14727681 ] Dawid Weiss commented on LUCENE-6774: - I actually plan to remove all that logic from ResourceUtils... it should be up to the caller to figure out how to locate dictionary resources -- that's where the knowledge of how to do it should be. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir >Priority: Blocker > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14728016#comment-14728016 ] ASF subversion and git services commented on LUCENE-6774: - Commit 1700903 from [~thetaphi] in branch 'dev/trunk' [ https://svn.apache.org/r1700903 ] LUCENE-6774: Remove classloader hack in MorfologikFilter #2 > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727875#comment-14727875 ] Uwe Schindler commented on LUCENE-6774: --- OK thanks. I will open separate issue about the factory. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727754#comment-14727754 ] Dawid Weiss commented on LUCENE-6774: - What you should be using is this explicit constructor: https://github.com/morfologik/morfologik-stemming/blob/master/morfologik-stemming/src/main/java/morfologik/stemming/Dictionary.java#L64 FSA can be read from an InputStream: https://github.com/morfologik/morfologik-stemming/blob/master/morfologik-fsa/src/main/java/morfologik/fsa/FSA.java#L256 And DictionaryMetadata can be constructed programmatically or otherwise. Here is the method that does the loading from two streams (FSA and properties): https://github.com/morfologik/morfologik-stemming/blob/master/morfologik-stemming/src/main/java/morfologik/stemming/Dictionary.java#L106-L156 > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14728018#comment-14728018 ] ASF subversion and git services commented on LUCENE-6774: - Commit 1700904 from [~thetaphi] in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1700904 ] Merged revision(s) 1700903 from lucene/dev/trunk: LUCENE-6774: Remove classloader hack in MorfologikFilter #2 > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727745#comment-14727745 ] Uwe Schindler commented on LUCENE-6774: --- Personally, I would also like to change the factory class to take the language code (for backwards compatibility) and otherwise use dict and meta file as separate config params. The default Lucene ResourceLoader interface would then convert them to a URL/InputStream, so it works in Solr from conf/ directory, too. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis >Reporter: Robert Muir >Assignee: Uwe Schindler >Priority: Blocker > Fix For: Trunk, 5.4, 5.3.1 > > Attachments: LUCENE-6774.patch, LUCENE-6774.patch, LUCENE-6774.patch, > LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727452#comment-14727452 ] Uwe Schindler commented on LUCENE-6774: --- I think the main problem is Morphologik that reads the resources from the context classloader - which is just wrong. I'd suggest to not use the static {{Dictionary#getForLanguage}} and instead load the FSA with the methods taking InputStream or URL from resources. We just need to duplicate the ISO code -> Resource file name code and then pass the resource URL from the "right" classloader to the load() methods. I can have a look. > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727461#comment-14727461 ] Robert Muir commented on LUCENE-6774: - Sorry, that is incorrect Uwe. Morfologik "tries" that loader, but it also does things correctly too. Look right here: https://github.com/morfologik/morfologik-stemming/blob/master/morfologik-fsa/src/main/java/morfologik/util/ResourceUtils.java#L40-L50 > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727462#comment-14727462 ] Robert Muir commented on LUCENE-6774: - I am committing this because such hacks should not be in lucene code. Please open a separate issue to deal with the solr hack better > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-6774) Remove solr hack in MorfologikFilter
[ https://issues.apache.org/jira/browse/LUCENE-6774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14727467#comment-14727467 ] ASF subversion and git services commented on LUCENE-6774: - Commit 1700837 from [~rcmuir] in branch 'dev/trunk' [ https://svn.apache.org/r1700837 ] LUCENE-6774: Remove solr hack in MorfologikFilter > Remove solr hack in MorfologikFilter > > > Key: LUCENE-6774 > URL: https://issues.apache.org/jira/browse/LUCENE-6774 > Project: Lucene - Core > Issue Type: Bug >Reporter: Robert Muir > Fix For: 5.3.1 > > Attachments: LUCENE-6774.patch > > > If solr wants to set the contextClassLoader because its classloading is > fucked up, then it needs to do this hack itself: it should not be in lucene > code. > The current mess prevents use of this analyzer in other environments -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org