|
|
-
Full sentence spellcheck
Valentin 2011-08-18, 15:31
I'm trying to configure a spellchecker to autocomplete full sentences from my query. I've already been able to get this results: /"american israel" : -> "american something" -> "israel something"/ But i want : /"american israel" : -> "american israel something"/ This is my solrconfig.xml : /<searchComponent name="suggest_full" class="solr.SpellCheckComponent"> <str name="queryAnalyzerFieldType">suggestTextFull</str> <lst name="spellchecker"> <str name="name">suggest_full</str> <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str> <str name="field">text_suggest_full</str> <str name="fieldType">suggestTextFull</str> </lst> </searchComponent> <requestHandler name="/suggest_full" class="org.apache.solr.handler.component.SearchHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <str name="spellcheck">true</str> <str name="spellcheck.dictionary">suggest_full</str> <str name="spellcheck.count">10</str> <str name="spellcheck.onlyMorePopular">true</str> </lst> <arr name="last-components"> <str>suggest_full</str> </arr> </requestHandler>/ And this is my schema.xml: /<fieldType name="suggestTextFull" class="solr.TextField"> <analyzer type="index"> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType> ... <field name="text_suggest_full" type="suggestTextFull" indexed="true" stored="false" multiValued="true"/>/ I've read somewhere that I have to use spellcheck.q because q use the WhitespaceAnalyzer, but when I use spellcheck.q i get a java.lang.NullPointerException Any ideas ? -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3265257.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-18, 15:31
-
Re: Full sentence spellcheck
Li Li 2011-08-19, 09:31
this may need something like language models to suggest. I found an issue https://issues.apache.org/jira/browse/SOLR-2585 what's going on with it? On Thu, Aug 18, 2011 at 11:31 PM, Valentin <[EMAIL PROTECTED]> wrote: > I'm trying to configure a spellchecker to autocomplete full sentences from my > query. > > I've already been able to get this results: > > /"american israel" : > -> "american something" > -> "israel something"/ > > But i want : > > /"american israel" : > -> "american israel something"/ > > This is my solrconfig.xml : > > /<searchComponent name="suggest_full" class="solr.SpellCheckComponent"> > <str name="queryAnalyzerFieldType">suggestTextFull</str> > <lst name="spellchecker"> > <str name="name">suggest_full</str> > <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> > <str > name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str> > <str name="field">text_suggest_full</str> > <str name="fieldType">suggestTextFull</str> > </lst> > </searchComponent> > > <requestHandler name="/suggest_full" > class="org.apache.solr.handler.component.SearchHandler"> > <lst name="defaults"> > <str name="echoParams">explicit</str> > <str name="spellcheck">true</str> > <str name="spellcheck.dictionary">suggest_full</str> > <str name="spellcheck.count">10</str> > <str name="spellcheck.onlyMorePopular">true</str> > </lst> > <arr name="last-components"> > <str>suggest_full</str> > </arr> > </requestHandler>/ > > And this is my schema.xml: > > /<fieldType name="suggestTextFull" class="solr.TextField"> > <analyzer type="index"> > <tokenizer class="solr.KeywordTokenizerFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> > </analyzer> > <analyzer type="query"> > <tokenizer class="solr.KeywordTokenizerFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > </analyzer> > </fieldType> > > ... > > <field name="text_suggest_full" type="suggestTextFull" indexed="true" > stored="false" multiValued="true"/>/ > > I've read somewhere that I have to use spellcheck.q because q use the > WhitespaceAnalyzer, but when I use spellcheck.q i get a > java.lang.NullPointerException > > Any ideas ? > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3265257.html> Sent from the Solr - User mailing list archive at Nabble.com. >
+
Li Li 2011-08-19, 09:31
-
Re: Full sentence spellcheck
Valentin 2011-08-19, 09:40
I don't think it wil lhelp me, sorry. I just want my query to not be tokenised, I want it to be considered as a full sentence to correct. But thanks for your answers, I keep searching. -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267629.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-19, 09:40
-
Re: Full sentence spellcheck
Li Li 2011-08-19, 10:35
I haven't used suggest yet. But in spell check if you don't provide spellcheck.q, it will analyze the q parameter by a converter which "tokenize" your query. else it will use the analyzer of the field to process parameter q. If you don't want to tokenize query, you should pass spellcheck.q and provide your own analyzer such as keyword analyzer. you can achieve this by add <str name="fieldType">string</str> <lst name="spellchecker"> <str name="classname">solr.FileBasedSpellChecker</str> <str name="name">file</str> <str name="sourceLocation">spellings.txt</str> <str name="characterEncoding">UTF-8</str> <str name="spellcheckIndexDir">./spellchecker2</str> <str name="fieldType">string</str> </lst> The wiki says <str name="queryAnalyzerFieldType">textSpell</str> But I read the codes of solr 1.4.1 and latest lucene/solr 4 trunk the both use the following codes. I think the wiki is out of date. public static final String FIELD_TYPE = "fieldType"; .... fieldTypeName = (String) config.get(FIELD_TYPE); if (core.getSchema().getFieldTypes().containsKey(fieldTypeName)) { FieldType fieldType = core.getSchema().getFieldTypes().get(fieldTypeName); analyzer = fieldType.getQueryAnalyzer(); } if you use file based spell check, it's ok. but for index based, if you tokenize the field, but do not tokenize your query, you still can get correct result. On Fri, Aug 19, 2011 at 5:40 PM, Valentin <[EMAIL PROTECTED]> wrote: > I don't think it wil lhelp me, sorry. I just want my query to not be > tokenised, I want it to be considered as a full sentence to correct. > > But thanks for your answers, I keep searching. > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267629.html> Sent from the Solr - User mailing list archive at Nabble.com. >
+
Li Li 2011-08-19, 10:35
-
Re: Full sentence spellcheck
Valentin 2011-08-19, 10:49
Li Li wrote: > If you don't want to tokenize query, you should pass spellcheck.q > and provide your own analyzer such as keyword analyzer. That's already what I do with my suggestTextFull fieldType, added to my searchComponent, no ? I've copied my fieldType and my searchComponent on my first post. The only big difference between your parameters and mine is: " <str name="characterEncoding">UTF-8</str> ". But I don't think it resolves the problem of the NullPointerException when i use spellcheck.q :/ -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267724.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-19, 10:49
-
Re: Full sentence spellcheck
Li Li 2011-08-19, 10:57
NullPointerException? do you have the full exception print stack? On Fri, Aug 19, 2011 at 6:49 PM, Valentin <[EMAIL PROTECTED]> wrote: > > Li Li wrote: >> If you don't want to tokenize query, you should pass spellcheck.q >> and provide your own analyzer such as keyword analyzer. > > That's already what I do with my suggestTextFull fieldType, added to my > searchComponent, no ? I've copied my fieldType and my searchComponent on my > first post. The only big difference between your parameters and mine is: > > " <str name="characterEncoding">UTF-8</str> ". > > But I don't think it resolves the problem of the NullPointerException when i > use spellcheck.q :/ > > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267724.html> Sent from the Solr - User mailing list archive at Nabble.com. >
+
Li Li 2011-08-19, 10:57
-
Re: Full sentence spellcheck
Valentin 2011-08-19, 11:23
My beautiful NullPointer Exception : SEVERE: java.lang.NullPointerException at org.apache.solr.handler.component.SpellCheckComponent.getTokens(SpellCheckComponent.java:476) at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:131) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267771.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-19, 11:23
-
Re: Full sentence spellcheck
Li Li 2011-08-19, 11:37
Line 476 of SpellCheckComponent.getTokens of mine is assert analyzer != null; it seems our codes' versions don't match. could you decompile your SpellCheckComponent.class ? On Fri, Aug 19, 2011 at 7:23 PM, Valentin <[EMAIL PROTECTED]> wrote: > My beautiful NullPointer Exception : > > > SEVERE: java.lang.NullPointerException > at > org.apache.solr.handler.component.SpellCheckComponent.getTokens(SpellCheckComponent.java:476) > at > org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:131) > at > org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194) > at > org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) > at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368) > at > org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356) > at > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) > at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) > at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) > at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) > at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) > at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > at org.mortbay.jetty.Server.handle(Server.java:326) > at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) > at > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > at > org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) > > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267771.html> Sent from the Solr - User mailing list archive at Nabble.com. >
+
Li Li 2011-08-19, 11:37
-
Re: Full sentence spellcheck
Li Li 2011-08-19, 11:39
or your analyzer is null? any other exception or warning in your log file? On Fri, Aug 19, 2011 at 7:37 PM, Li Li <[EMAIL PROTECTED]> wrote: > Line 476 of SpellCheckComponent.getTokens of mine is assert analyzer != null; > it seems our codes' versions don't match. could you decompile your > SpellCheckComponent.class ? > > > On Fri, Aug 19, 2011 at 7:23 PM, Valentin <[EMAIL PROTECTED]> wrote: >> My beautiful NullPointer Exception : >> >> >> SEVERE: java.lang.NullPointerException >> at >> org.apache.solr.handler.component.SpellCheckComponent.getTokens(SpellCheckComponent.java:476) >> at >> org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:131) >> at >> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194) >> at >> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) >> at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368) >> at >> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356) >> at >> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252) >> at >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) >> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) >> at >> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) >> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) >> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) >> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) >> at >> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) >> at >> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) >> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) >> at org.mortbay.jetty.Server.handle(Server.java:326) >> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) >> at >> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) >> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) >> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) >> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) >> at >> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) >> at >> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) >> >> >> -- >> View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267771.html>> Sent from the Solr - User mailing list archive at Nabble.com. >> >
+
Li Li 2011-08-19, 11:39
-
Re: Full sentence spellcheck
Valentin 2011-08-19, 12:01
My analyser is not empty : /<fieldType name="suggestTextFull" class="solr.TextField"> <analyzer type="index"> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType>/ and i'm sure there is words in it I don't know where to find this file "org.apache.solr.handler.component.SpellCheckComponent.getTokens" -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267833.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-19, 12:01
-
Re: Full sentence spellcheck
Will Oberman 2011-08-19, 12:35
This might be unrelated, but I had the exact same error yesterday trying to replace the query converter with a custom class I wrote. Ended up, I wasn't properly registering my jar. I'm still testing with jetty, and "lib" in example is included "too late" in the startup process. I had to rebundle the war with my jar in the web-inf lib. On Aug 19, 2011, at 8:01 AM, Valentin <[EMAIL PROTECTED]> wrote: > My analyser is not empty : > > /<fieldType name="suggestTextFull" class="solr.TextField"> > <analyzer type="index"> > <tokenizer class="solr.KeywordTokenizerFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> > </analyzer> > <analyzer type="query"> > <tokenizer class="solr.KeywordTokenizerFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > </analyzer> > </fieldType>/ > > and i'm sure there is words in it > > > I don't know where to find this file > "org.apache.solr.handler.component.SpellCheckComponent.getTokens" > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267833.html> Sent from the Solr - User mailing list archive at Nabble.com.
+
Will Oberman 2011-08-19, 12:35
-
Re: Full sentence spellcheck
William Oberman 2011-08-19, 13:05
I was on my phone before, and didn't see the whole thread. I wanted the same thing, to have spellchecker not tokenize. See the "Suggester Issues" thread for my junky replacement class that doesn't tokenize (as far as I can tell from a few minutes of testing). will On Aug 19, 2011, at 8:35 AM, Will Oberman wrote: > This might be unrelated, but I had the exact same error yesterday trying to replace the query converter with a custom class I wrote. Ended up, I wasn't properly registering my jar. I'm still testing with jetty, and "lib" in example is included "too late" in the startup process. I had to rebundle the war with my jar in the web-inf lib. > > On Aug 19, 2011, at 8:01 AM, Valentin <[EMAIL PROTECTED]> wrote: > >> My analyser is not empty : >> >> /<fieldType name="suggestTextFull" class="solr.TextField"> >> <analyzer type="index"> >> <tokenizer class="solr.KeywordTokenizerFactory"/> >> <filter class="solr.LowerCaseFilterFactory"/> >> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> >> </analyzer> >> <analyzer type="query"> >> <tokenizer class="solr.KeywordTokenizerFactory"/> >> <filter class="solr.LowerCaseFilterFactory"/> >> </analyzer> >> </fieldType>/ >> >> and i'm sure there is words in it >> >> >> I don't know where to find this file >> "org.apache.solr.handler.component.SpellCheckComponent.getTokens" >> >> -- >> View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3267833.html>> Sent from the Solr - User mailing list archive at Nabble.com.
+
William Oberman 2011-08-19, 13:05
-
Re: Full sentence spellcheck
Valentin 2011-08-22, 13:02
I found the thread "Suggester Issues". You said to write a new java class : package com.civicscience; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import org.apache.lucene.analysis.Token; import org.apache.solr.spelling.QueryConverter; /** * Converts the query string to a Collection of Lucene tokens. **/ public class SpellingQueryConverter extends QueryConverter { /** * Converts the original query string to a collection of Lucene Tokens. * @param original the original query string * @return a Collection of Lucene Tokens */ @Override public Collection<Token> convert(String original) { if (original == null) { return Collections.emptyList(); } Collection<Token> result = new ArrayList<Token>(); Token token = new Token(original, 0, original.length(), "word"); result.add(token); return result; } } But I don't know where and how to write it. Can you help me ? Moreover, will it change my other spellcheckers too ? I have some other that I don't want to be modified... Thanks. -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3274956.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-22, 13:02
-
Re: Full sentence spellcheck
William Oberman 2011-08-22, 13:09
I listed the basic steps I took in the other thread (recently), which were: -Downloaded apache-solr-3.3.0 archive (I like to stick with releases vs. svn) -Untar (tar -xzvf) and cd -ant (to compile) -mkdir something, cd something (e.g. create a peer directory in apache-solr-3.3.0) -Wrote my class below (you have to create dirs == your package, so for me I neede com/civicscience) -javac -cp ../dist/apache-solr-core-3.3.0.jar:../lucene/build/lucene-core-3.3-SNAPSHOT.jar com/civicscience/SpellingQueryConverter.java -jar cf cs.jar com -Unzipped solr.war (under example) -Added my cs.jar to lib (under web-inf) -Rezipped solr.war -Added: <queryConverter name="queryConverter" class="com.civicscience.SpellingQueryConverter"/> to solrconfig.xml -Restarted jetty The part that had me stuck for awhile was that dropping my class into example/lib didn't work, but putting it in the war did. I don't know if you can specify QueryConverters other than globally, I'm really new to solr myself. Good luck! will On Aug 22, 2011, at 9:02 AM, Valentin wrote: > I found the thread "Suggester Issues". You said to write a new java class : > > package com.civicscience; > > import java.util.ArrayList; > import java.util.Collection; > import java.util.Collections; > > import org.apache.lucene.analysis.Token; > import org.apache.solr.spelling.QueryConverter; > > /** > * Converts the query string to a Collection of Lucene tokens. > **/ > public class SpellingQueryConverter extends QueryConverter { > > /** > * Converts the original query string to a collection of Lucene Tokens. > * @param original the original query string > * @return a Collection of Lucene Tokens > */ > @Override > public Collection<Token> convert(String original) { > if (original == null) { > return Collections.emptyList(); > } > Collection<Token> result = new ArrayList<Token>(); > Token token = new Token(original, 0, original.length(), "word"); > result.add(token); > return result; > } > > } > > > But I don't know where and how to write it. Can you help me ? > > Moreover, will it change my other spellcheckers too ? I have some other that > I don't want to be modified... > > Thanks. > > -- > View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3274956.html> Sent from the Solr - User mailing list archive at Nabble.com.
+
William Oberman 2011-08-22, 13:09
-
Re: Full sentence spellcheck
Valentin 2011-08-22, 15:28
Thanks, but i have a last question before trying your solution : did you have the same NullPointerException before ? I want to be sure that is the only way to resolve my problem before midifying some java files... -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3275380.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-22, 15:28
-
Re: Full sentence spellcheck
William Oberman 2011-08-22, 16:38
I had an NPE on the same line, but from googling it seems like that NPE can happen for different reasons, so I couldn't say if my situation was exactly the same as yours. I will say I get phrase based suggestions now. will On Mon, Aug 22, 2011 at 11:28 AM, Valentin <[EMAIL PROTECTED]> wrote: > Thanks, but i have a last question before trying your solution : did you > have > the same NullPointerException before ? I want to be sure that is the only > way to resolve my problem before midifying some java files... > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3275380.html> Sent from the Solr - User mailing list archive at Nabble.com. >
+
William Oberman 2011-08-22, 16:38
-
Re: Full sentence spellcheck
Valentin 2011-08-23, 12:32
I tried your solution, it works. But it modify all the spellcheckers that I made, so that's not a good solution for me (I have an autocomplete and a regular spellcheck with separated words that I want to keep). I tried to move the line "<queryConverter name="queryConverter" class="com.myPackage.SpellingQueryConverter"/>" *into* the requestHandler, but of course it does not work. Why I can't just use this evil spellcheck.q ? -_- -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3277847.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Valentin 2011-08-23, 12:32
+
Valentin 2011-08-24, 14:58
-
RE: Full sentence spellcheck
Dyer, James 2011-08-18, 17:11
If you use "spellcheck.q", you also still need to specify "q" for the queryhandler, otherwise you'll get an NPE. Not sure that's your problem but its one thing to check. James Dyer E-Commerce Systems Ingram Content Group (615) 213-4311 -----Original Message----- From: Valentin [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 18, 2011 10:32 AM To: [EMAIL PROTECTED] Subject: Full sentence spellcheck I'm trying to configure a spellchecker to autocomplete full sentences from my query. I've already been able to get this results: /"american israel" : -> "american something" -> "israel something"/ But i want : /"american israel" : -> "american israel something"/ This is my solrconfig.xml : /<searchComponent name="suggest_full" class="solr.SpellCheckComponent"> <str name="queryAnalyzerFieldType">suggestTextFull</str> <lst name="spellchecker"> <str name="name">suggest_full</str> <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str> <str name="field">text_suggest_full</str> <str name="fieldType">suggestTextFull</str> </lst> </searchComponent> <requestHandler name="/suggest_full" class="org.apache.solr.handler.component.SearchHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <str name="spellcheck">true</str> <str name="spellcheck.dictionary">suggest_full</str> <str name="spellcheck.count">10</str> <str name="spellcheck.onlyMorePopular">true</str> </lst> <arr name="last-components"> <str>suggest_full</str> </arr> </requestHandler>/ And this is my schema.xml: /<fieldType name="suggestTextFull" class="solr.TextField"> <analyzer type="index"> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType> ... <field name="text_suggest_full" type="suggestTextFull" indexed="true" stored="false" multiValued="true"/>/ I've read somewhere that I have to use spellcheck.q because q use the WhitespaceAnalyzer, but when I use spellcheck.q i get a java.lang.NullPointerException Any ideas ? -- View this message in context: http://lucene.472066.n3.nabble.com/Full-sentence-spellcheck-tp3265257p3265257.htmlSent from the Solr - User mailing list archive at Nabble.com.
+
Dyer, James 2011-08-18, 17:11
+
Valentin 2011-08-19, 07:40
|
|