Posts tagged: SOLR

SOLR Optimize URL

To optimize a SOLR instance from a browser specify:

http://localhost:8983/solr/update?optimize=true

SOLR 1.3 – Field collapsing

To enable Field Collapsing in SOLR 1.3 , simplest setup is a separate handler,

<searchComponent name="collapse" class="org.apache.solr.handler.component.CollapseComponent" />
<requestHandler name="/collapse" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
</lst>
<arr name="components">
<str>query</str>
<str>facet</str>
<str>mlt</str>
<str>highlight</str>
<str>debug</str>
<str>collapse</str>
</arr>
</requestHandler>

Eclipse and Solr

To prepare

solr-1.2 only – Make sure you have a copy of some version of  ‘junit’ in ./lib.

solr-1.3 junit seems to be found automatically

To create a project in Eclipse

File > New > Java Project

In ‘Create Java Project’ dialog:

Select ‘Create Project from existing source’. Select directory where the TOP of the code tree lives. Leave other defaults alone.

Select ‘Finish’

Setup build file as an Eclipse build file

Project > Properties > Builders > New > Ant Builder

On ‘Main’ tab:

  • Locate ‘build.xml’
  • Set base directory to top of build tree
  • For argument, add ‘compile’
  • Apply

On ‘Targets’ tab:

  • Manual build ‘compilel’
  • Automatic build ‘compile’

Problems

If you run into problems, particularly with the ‘junit’ library not being found.

Project > Properties > Builders > [pick builder] >

In ‘Classpath’ tab, ‘Add Jars’,  select ‘junit’ from list in ./lib and add it.

Java / SOLR – Lock timeouts

Actual error:

java.io.IOException: Lock obtain timed out: SimpleFSLock

A good set of suggestions on this SOLR thread.

SOLR Remove write locks

To delete a write lock in SOLR

rm solr/data/index/write.lock

WordPress Themes