Re: Spellcheck: using multiple dictionaries (DirectSolrSpellChecker and FileBasedSpellChecker)
Ok, thanks Andrey. On Tue, 27 Sep 2016 at 00:13 Kydryavtsev Andreywrote: > Hello, Ryan > > > As it obvious from exception message - you are forced to use same instance > of Analyzer to all of spell checkers which should be conjuncted. > > How this instance is initialized inside SpellChecker instance could be > found here - > https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/spelling/SolrSpellChecker.java#L65 > > So one of possibilities to make it work - use same field for both spell > checkers. solrconfig.xml could looks like this: > > > default > solr.DirectSolrSpellChecker > field_for_spell_check > … > > > > > wordbreak > solr.WordBreakSolrSpellChecker > field_for_spell_check > …. > > > 23.09.2016, 12:13, "Ryan Yacyshyn" : > > Hi everyone, > > > > I'm looking at using two different implementations of spell checking > > together: DirectSolrSpellChecker and FileBasedSpellChecker but I get the > > following error: > > > > msg: "All checkers need to use the same Analyzer.", > > trace: "java.lang.IllegalArgumentException: All checkers need to use the > > same Analyzer. at > > > org.apache.solr.spelling.ConjunctionSolrSpellChecker.addChecker(ConjunctionSolrSpellChecker.java:79) > > at > > > org.apache.solr.handler.component.SpellCheckComponent.getSpellChecker(SpellCheckComponent.java:603) > > at > > > org.apache.solr.handler.component.SpellCheckComponent.prepare(SpellCheckComponent.java:126) > > at ... > > > > The source mentions that the "initial use-case was to use > > WordBreakSolrSpellChecker in conjunction with the > DirectSolrSpellChecker". > > > > If I make a query with only of the dictionaries (file or direct), they > both > > work fine, combining them into one query throws the error. I'm not sure > if > > I'm doing something wrong or if I just can't use these two together > (yet). > > > > I'm using 6.2.0. Thanks for any help! > > > > Ryan >
Re: Spellcheck: using multiple dictionaries (DirectSolrSpellChecker and FileBasedSpellChecker)
Hello, Ryan As it obvious from exception message - you are forced to use same instance of Analyzer to all of spell checkers which should be conjuncted. How this instance is initialized inside SpellChecker instance could be found here - https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/spelling/SolrSpellChecker.java#L65 So one of possibilities to make it work - use same field for both spell checkers. solrconfig.xml could looks like this: default solr.DirectSolrSpellChecker field_for_spell_check … wordbreak solr.WordBreakSolrSpellChecker field_for_spell_check …. 23.09.2016, 12:13, "Ryan Yacyshyn": > Hi everyone, > > I'm looking at using two different implementations of spell checking > together: DirectSolrSpellChecker and FileBasedSpellChecker but I get the > following error: > > msg: "All checkers need to use the same Analyzer.", > trace: "java.lang.IllegalArgumentException: All checkers need to use the > same Analyzer. at > org.apache.solr.spelling.ConjunctionSolrSpellChecker.addChecker(ConjunctionSolrSpellChecker.java:79) > at > org.apache.solr.handler.component.SpellCheckComponent.getSpellChecker(SpellCheckComponent.java:603) > at > org.apache.solr.handler.component.SpellCheckComponent.prepare(SpellCheckComponent.java:126) > at ... > > The source mentions that the "initial use-case was to use > WordBreakSolrSpellChecker in conjunction with the DirectSolrSpellChecker". > > If I make a query with only of the dictionaries (file or direct), they both > work fine, combining them into one query throws the error. I'm not sure if > I'm doing something wrong or if I just can't use these two together (yet). > > I'm using 6.2.0. Thanks for any help! > > Ryan
Spellcheck: using multiple dictionaries (DirectSolrSpellChecker and FileBasedSpellChecker)
Hi everyone, I'm looking at using two different implementations of spell checking together: DirectSolrSpellChecker and FileBasedSpellChecker but I get the following error: msg: "All checkers need to use the same Analyzer.", trace: "java.lang.IllegalArgumentException: All checkers need to use the same Analyzer. at org.apache.solr.spelling.ConjunctionSolrSpellChecker.addChecker(ConjunctionSolrSpellChecker.java:79) at org.apache.solr.handler.component.SpellCheckComponent.getSpellChecker(SpellCheckComponent.java:603) at org.apache.solr.handler.component.SpellCheckComponent.prepare(SpellCheckComponent.java:126) at ... The source mentions that the "initial use-case was to use WordBreakSolrSpellChecker in conjunction with the DirectSolrSpellChecker". If I make a query with only of the dictionaries (file or direct), they both work fine, combining them into one query throws the error. I'm not sure if I'm doing something wrong or if I just can't use these two together (yet). I'm using 6.2.0. Thanks for any help! Ryan