Nov
02
2009

Working with LocalSolr and Lucene 2.9.1rc3 / Solr 1.4rc1

Copy of a posting made on solr-user list just in case it’s handy for anyone out there.

I’ve been trying to prepare a project using localsolr for the impending (I hope) arrival of solr 1.4 and Lucene 2.9.1.. Here are some notes in case anyone else is suffering similarly. Obviously everything here may change by next week.

First problem has been the lack of any stable maven based lucene and solr artifacts to wire into my poms. Because of that, and as an interim only measure, I’ve built the latest branches of the lucene 2.9.1 and solr 1.4 trees and made them into a *temporary* maven repository at http://developer.k-int.com/m2snapshots/. in there you can find all the jar artifacts tagged as xxx-ki-rc1 (For solr) and xxx-ki-rc3 (For lucene) and finally, a localsolr.localsolr build tagged as 1.5.2-rc1. Sorry for the naming, but I don’t want these artifacts to clash with the real ones when they come along. This is really just for my own use, but I’ve seen messages and spoken to people who are really struggling to get their maven deps right, if this helps anyone, please feel free to use these until the real apache artifacts appear. I can’t take any responsibility for their quality. All the poms have been altered to look for the correct dependent artifacts in the same repository, adding the stanza




k-int-m2-snapshots
K-int M2 Snapshots
http://developer.k-int.com/m2snapshots

true


to your pom will let you use these deps temporarily until we see an official build. If you’re a maven developer and I’ve gone way around the houses with this, please tell me of an easier solution :) This repo *will* go away when the real builds turn up.

The localsolr in this repo also contains the patches I’ve submitted (A good while ago) to the localsolr project to make it build with the lucene 2.9.1 rc3 as the downloadable dist is currently built against an older 2.9 release that had a different API (IE won’t work with the new lucene and solr)

All this means that there is a working localsolr build.

Second up, I’ve also seen emails (And seen the exception myself) around asking about the following when trying to get all these revisions working together.

java.lang.NumberFormatException: Invalid shift value in prefixCoded string
(is encoded value really a LONG?)

There are some threads out there telling you that the Lucene indexes are not binary compatible between versions, but if you’re using localsolr, what you really need to know is:

1) Make sure that your schema.xml contains at least the following fieldType defs

2) Convert your old solr sdouble fields to tdoubles:



Pretty sure you would need to rebuild your indexes.

Ok, with those changes I managed to get a working spatial search.

My only problem now is that the radius param on the command line seems to need to be way bigger than it needs to be in order to find anything. Specifically, if I search with a radius of 220 I get a record back which marks it’s geo_distance as “83.76888211666025″. Shuffling the radius around ends up that a radius of 205 returns that doc, 204 and it’s filtered. I’m going to dig into this now, but if anyone knows about this I’d really appreciate any help.

Cheers all, hope this is of use to someone out there, if anyone has corrections/comments I’d really appreciate any info.

Best,
Ian.

tags: , , , ,
posted in Uncategorized by ianibbo

Follow comments via the RSS Feed | Leave a comment | Trackback URL

6 Comments to "Working with LocalSolr and Lucene 2.9.1rc3 / Solr 1.4rc1"

  1. Dave C wrote:

    Hi Ian,

    I’m having the same trouble I can’t get anything back once i’ve index a document:

    Here’s the Document i have indexed:

    0
    0

    on
    0
    *:*
    10
    2.2

    0.0
    0.0
    0.0
    0.0
    0.0
    0.0
    0.0
    1.0E-6
    1.000002
    3.000005
    6.000001
    13.0000021
    26.0000042
    52.0000085
    104.0000017
    0.0
    0.0
    0.0
    0.0
    0.0
    0.0
    52.2439
    0.104801
    My Record

    And here is my request to localSolr:

    http://127.0.0.1:8080/solr/select?&qt=geo&q=zxy&long=0.104801&qt=geo&lat=52.2439&radius=250

    I’m getting nothing back? Any ideas?

    00

  2. Dave C wrote:

    Ahhh Worked it out i needed to do the following query:

    http://127.0.0.1:8080/solr/select?&qt=geo&q=My&long=0.104801&qt=geo&lat=52.2439&radius=250

    I’d not updated the q to include indexed text. Doh.

    Sorry about not encoding the xml as i posted.. You can remove my comment if you’d like

  3. CraftyFella wrote:

    Hi,

    I’ve setup a Step by step user guide to installing LocalSolr on Solr 1.4 on windows. Here’s the link.. Hope someone finds it useful:

    http://craftyfella.blogspot.com/2009/12/installing-localsolr-onto-solr-14.html

  4. apit wrote:

    hi, thanks for sharing this. i hit the same error.

  5. rob ganly wrote:

    hi there,

    i followed craftyfella’s install instructions but for linux and have been getting:

    java.lang.NoClassDefFoundError: org/apache/solr/handler/component/SearchHandler

    errors. checked dependent classes, jar files etc. but can’t find a solution, is this an issue with trying to use localsolr with solr 1.4?

    i implemented a solution using a nightly build of solr 1.5 which works great but we can’t rely on it for production (esp. as it may never be released with the poss. of solr 3.1 being released!).

    any help appreciated!

    best,

    rob ganly

  6. ianibbo wrote:

    Hiya Rob, nope, we have things working fine on Solr 1.4 I’m afraid…. I find this class listed in a jar tvf of solr-core-1.4.0.jar. Find it hard to see how this can be localsolr induced. Does your solr work fine apart from spatial processes, or is the webapp totally shot?

Leave Your Comment

5 visitors online now
5 guests, 0 members
Max visitors today: 5 at 10:35 pm UTC
This month: 5 at 09-04-2010 10:35 pm UTC
This year: 32 at 08-31-2010 10:32 am UTC
All time: 32 at 08-31-2010 10:32 am UTC
 
Powered by Wordpress and MySQL. Theme by openark.org