You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ranjit Raveendran <co...@yahoo.com> on 2009/07/25 05:16:57 UTC

Core not reloading in Solr 1.3

Hi,

I had emailed before about the following issue but did not get a response.

I have been trying to reload the Solr core after I make changes to the synonyms.txt file. With Solr 1.3, I am able to do a reload only after the first change but not in subsequent attempts (after subsequent changes to synonyms.txt).  The reloads work fine with Solr nightly builds though (i.e. I query using synonyms & get the desired results).

I was wondering if someone could throw some light to this issue. I also tried running Solr 1.3 throught Tomcat 6 but I see the same issue.

Thank you,
Ranjit.


FYI, my solrconfig.xml is:

<?xml version="1.0" encoding="UTF-8" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<!--
 This is a stripped down config file used for a simple example...  
 It is *not* a good example to work from. 
-->
<config>
  <updateHandler class="solr.DirectUpdateHandler2" />

  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <lst name="spellchecker">
      <!-- 
           Optional, it is required when more than one spellchecker is configured.
           Select non-default name with spellcheck.dictionary in request handler.
      -->
      <str name="name">default</str>
      <!-- The classname is optional, defaults to IndexBasedSpellChecker -->
      <str name="classname">solr.IndexBasedSpellChecker</str>
      <!--
               Load tokens from the following field for spell checking, 
               analyzer for the field's type as defined in schema.xml are used
      -->
      <str name="field">name</str>
      <!-- Optional, by default use in-memory index (RAMDirectory) -->
      <str name="spellcheckIndexDir">./spellchecker</str>
      <!-- Set the accuracy (float) to be used for the suggestions. Default is 0.5 -->
      <str name="accuracy">0.7</str>
    </lst>
    <!-- Example of using 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">./spellchecker</str>

    </lst>
-->
    <!-- This field type's analyzer is used by the QueryConverter to tokenize the value for "q" parameter -->
    <str name="queryAnalyzerFieldType">textSpell</str>
  </searchComponent>
  <queryConverter name="queryConverter" class="solr.SpellingQueryConverter"/>



  <requestDispatcher handleSelect="true" >
    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
  </requestDispatcher>
  
  <requestHandler name="standard" class="solr.StandardRequestHandler" default="true">
    <arr name="last-components">
      <str>spellcheck</str>
    </arr>
  </requestHandler>
  <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
  <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
  <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
      <str name="config">./db-data-config.xml</str>
    </lst>
  </requestHandler>

  <!-- config for the admin interface --> 
  <admin>
    <defaultQuery>solr</defaultQuery>
  </admin>

</config>


--------------------------------------------------------------------------------------------------------------

My schema.xml is:


<?xml version="1.0" ?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<schema name="example core one" version="1.1">
  <types>
   <fieldtype name="string"  class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
   <fieldType name="sfloat" class="solr.SortableFloatField" sortMissingLast="true" omitNorms="true"/>
   <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.HTMLStripWhitespaceTokenizerFactory"/>
<!--        <filter class="solr.WhitespaceTokenizerFactory"/> -->
        <filter class="solr.WordDelimiterFilterFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/> 
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
   </fieldType> 
  </types>

 <fields>   
  <!-- general -->
  <field name="id"       type="string"    indexed="true"  stored="true"  multiValued="false" required="true"/>
  <field name="name"     type="text"    indexed="true"  stored="true"  multiValued="false" /> 
  <field name="summary"     type="text"    indexed="true"  stored="true"  multiValued="false" /> 
  <field name="popularity" type="sfloat" indexed="true" stored="true" default="0"/>
<!--  
  <field name="type"     type="string"    indexed="true"  stored="true"  multiValued="false" /> 
  <field name="core1"    type="string"    indexed="true"  stored="true"  multiValued="false" /> 
-->
 </fields>

 <!-- field to use to determine and enforce document uniqueness. -->
 <uniqueKey>id</uniqueKey>

 <!-- field for the QueryParser to use when an explicit fieldname is absent -->
 <defaultSearchField>name</defaultSearchField>

 <!-- SolrQueryParser configuration: defaultOperator="AND|OR" -->
 <solrQueryParser defaultOperator="OR"/>
</schema>





      

Re: Core not reloading in Solr 1.3

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Sat, Jul 25, 2009 at 8:46 AM, Ranjit Raveendran <
contact_ranjit_now@yahoo.com> wrote:

> Hi,
>
> I had emailed before about the following issue but did not get a response.
>
> I have been trying to reload the Solr core after I make changes to the
> synonyms.txt file. With Solr 1.3, I am able to do a reload only after the
> first change but not in subsequent attempts (after subsequent changes to
> synonyms.txt).  The reloads work fine with Solr nightly builds though (i.e.
> I query using synonyms & get the desired results).
>
> I was wondering if someone could throw some light to this issue. I also
> tried running Solr 1.3 throught Tomcat 6 but I see the same issue.
>

I see that you are using synonyms at index time therefore, changes to the
synonym file cannot affect the documents which are already indexed. Although
the changes to the synonym files are picked up after a core reload,
documents which were indexed with the previous version of the synonym file
will not have the new tokens and hence will not match.

-- 
Regards,
Shalin Shekhar Mangar.

Re: Core not reloading in Solr 1.3

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
On Tue, Jul 28, 2009 at 6:39 AM, Erik Hatcher<er...@ehatchersolutions.com> wrote:
>
> On Jul 27, 2009, at 6:13 PM, ranjitr wrote:
>
>>
>> Ok, I think I found an alternative.
>>
>> With Solr 1.3, trying to reload the core from the browser using:
>> http://localhost:8984/solr/admin/cores?action=RELOAD\&core=core1
>>
>> doesn't work (this problem does not happen with nightly build).
>>
>>
>> But I  use curl as in:
>> curl http://localhost:8984/solr/admin/cores?action=RELOAD\&core=core1
>>
>> I'm able to reload the core multiple times.
>>
>>
>> So, there is something amiss about Solr 1.3 responding to requests sent
>> through the browser (Firefox/IE) versus using curl.
>
> You're probably getting bitten by admin handlers being cached by your
> browser.  Fixed on trunk: http://issues.apache.org/jira/browse/SOLR-1243
>
>        Erik

this must be the reason. great catch. do a force reload (ctrl+F5)
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Core not reloading in Solr 1.3

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 27, 2009, at 6:13 PM, ranjitr wrote:

>
> Ok, I think I found an alternative.
>
> With Solr 1.3, trying to reload the core from the browser using:
> http://localhost:8984/solr/admin/cores?action=RELOAD\&core=core1
>
> doesn't work (this problem does not happen with nightly build).
>
>
> But I  use curl as in:
> curl http://localhost:8984/solr/admin/cores?action=RELOAD\&core=core1
>
> I'm able to reload the core multiple times.
>
>
> So, there is something amiss about Solr 1.3 responding to requests  
> sent
> through the browser (Firefox/IE) versus using curl.

You're probably getting bitten by admin handlers being cached by your  
browser.  Fixed on trunk: http://issues.apache.org/jira/browse/SOLR-1243

	Erik


Re: Core not reloading in Solr 1.3

Posted by ranjitr <co...@yahoo.com>.
Ok, I think I found an alternative.

With Solr 1.3, trying to reload the core from the browser using:
http://localhost:8984/solr/admin/cores?action=RELOAD\&core=core1

doesn't work (this problem does not happen with nightly build).


But I  use curl as in:
 curl http://localhost:8984/solr/admin/cores?action=RELOAD\&core=core1

I'm able to reload the core multiple times.


So, there is something amiss about Solr 1.3 responding to requests sent
through the browser (Firefox/IE) versus using curl.


Thanks.
-- 
View this message in context: http://www.nabble.com/Core-not-reloading-in-Solr-1.3-tp24654530p24689221.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Core not reloading in Solr 1.3

Posted by ranjitr <co...@yahoo.com>.
Hi,

I'm seeing the same problem with the SWAP CoreAdmin command.

With Solr nightly build, I can create a new core with the CREATE admin
command & do a SWAP as many times as I like.
I see the following after I issue the SWAP command:

"INFO: swaped: core1 with core3"


But with Solr 1.3, I'm able to do a SWAP & see the above message only after
the first time I issue the command. Successive SWAPs don't seem to work.


There seems to be some threading issue (a resource is being blocked?) in
Solr 1.3 (& apparently resolved in nightly build) thats preventing
successive core reloads & swaps.

Please confirm.

Thank you.
-- 
View this message in context: http://www.nabble.com/Core-not-reloading-in-Solr-1.3-tp24654530p24685261.html
Sent from the Solr - User mailing list archive at Nabble.com.