lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajini maski <rajinima...@gmail.com>
Subject Re: Spell-Check Component Functionality
Date Fri, 19 Nov 2010 06:02:37 GMT
Hello Peter,
        Thanks For reply :)I did spellcheck.q=Curst as you said ...Query is
like:

http://localhost:8909/solr/select/?spellcheck.q=Curst&version=2.2&start=0&rows=10&indent=on&spellcheck=true



I am getting this error :(

HTTP Status 500 - null java.lang.NullPointerException at
java.io.StringReader.<init>(Unknown Source) at
org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:197) at
org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:78) at
org.apache.solr.search.QParser.getQuery(QParser.java:131) at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:89)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:174)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at


What is the error mean ... ? what do I need to do for this.. Any mistake in
config?

The config.xml and schema I have attached in the mail below FYI..Please let
me know if anyone know why is this error..

Awaiting reply
Rajani Maski


On Thu, Nov 18, 2010 at 8:09 PM, Peter Karich <peathal@yahoo.de> wrote:

>  Hi Rajani,
>
> some notes:
>  * try spellcheck.q=curst or completely without spellcheck.q but with q
>  * compared to the normal q parameter spellcheck.q can have a different
> analyzer/tokenizer and is used if present
>  * do not do spellcheck.build=true for every request (creating the
> spellcheck index can be very expensive)
>  * if you got spellcheck working embed the spellcheck component into your
> normal query component. otherwise you need to query 2 times ...
>
> Regards,
> Peter.
>
>
>  All,
>>
>>     I am trying apply the Solr spell check component functionality to our
>> data.
>>
>> The configuration set up I needed to make for it by updating config.xml
>> and
>> schema.xml is done as follows..
>> Please let me know if any errors in it.
>>
>>  I am not getting any suggestions in suggestion tags of solr output xml.
>>
>> I indexed word "Crust" to the field textSpell that is enabled for spell
>> check and then I searched for
>> "Curst"
>>
>> The queries i tried were :
>>
>> http://localhost:8909/solr/spell?q=Curst&spellcheck=true&spellcheck.collate=true&spellcheck.build=true&spellcheck.q=true
>>
>>
>> http://localhost:8909/solr/spell?q=Cruste&spellcheck=true&spellcheck.collate=true&spellcheck.build=true&spellcheck.q=true&spellcheck.dictionary=default
>>
>>
>> The CONFIG.XML :
>>
>> <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
>>     <lst name="spellchecker">
>>       <str name="name">default</str>
>>       <str name="field">spell</str>
>>       <str name="spellcheckIndexDir">./spellchecker</str>
>>     </lst>
>>
>>     <!-- a spellchecker that uses a different distance measure -->
>>     <lst name="spellchecker">
>>       <str name="name">jarowinkler</str>
>>       <str name="field">lowerfilt</str>
>>       <str
>>
>> name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
>>       <str name="spellcheckIndexDir">./spellchecker2</str>
>>     </lst>
>>      <str name="queryAnalyzerFieldType">textSpell</str>
>> </searchComponent>
>>
>> <requestHandler name="/spell" class="solr.SearchHandler" lazy="true">
>>     <lst name="defaults">
>> <str name="spellcheck.dictionary">default</str>
>>       <!-- omp = Only More Popular -->
>>       <str name="spellcheck.onlyMorePopular">false</str>
>>       <!-- exr = Extended Results -->
>>       <str name="spellcheck.extendedResults">false</str>
>>       <!--  The number of suggestions to return -->
>>       <str name="spellcheck.count">1</str>
>>     </lst>
>>     <arr name="last-components">
>>       <str>spellcheck</str>
>>     </arr>
>>   </requestHandler>
>>
>>
>>
>> SCHEMA:
>>
>> <fieldType name="textSpell" class="solr.TextField"
>> positionIncrementGap="100">
>>   <analyzer type="index">
>> <tokenizer class="solr.StandardTokenizerFactory"/>
>> <filter class="solr.LowerCaseFilterFactory"/>
>> <filter class="solr.StandardFilterFactory"/>
>> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>> </analyzer>
>>   <analyzer type="query">
>> <tokenizer class="solr.StandardTokenizerFactory"/>
>> <filter class="solr.LowerCaseFilterFactory"/>
>> <filter class="solr.StandardFilterFactory"/>
>> <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>> </analyzer>
>> </fieldType>
>>
>>
>> <field name="spell"  type="textSpell"  indexed="true" stored="true" />
>>
>>
>> If any error in above that is not enabling spell check please let me know.
>>
>> The output I am getting is like null  suggetions
>>
>> <lst>
>> <Suggesstions/>
>> </lst>
>>
>>
>> Regards,
>> Rajani Maski
>>
>>
>
> --
> http://jetwick.com twitter search prototype
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message