Some thoughts on at least some of your questions:
Field types: you'll probably want to index things like titles in two
fields, one tokenized (text) and one not (string), so that you can
retrieve and match the full title as well as searching for terms within
it. See the way the Solr sample app uses "*_exact" fields. You can use
the copyfield setting to avoid having to input the value twice.
The same considerations affect whether you want to use multi-valued
fields: if you're going to facet on that field, you want distinct
values, not a concatenated series; if you're only going to do free term
searching, the concatenation might not be a problem (though you risk
getting matches on phrase searches like "James Miller" against the
example you gave below).
If you use boost on the date field the way you suggest, remember you'll
have to reindex from scratch every year to adjust the boost as items
age. The sample solrconfig.xml contains an example of date-wrangling to
get the same effect based on distance from the current date, rather than
hard-coding the boost into the index.
The only point in interim commits is to make the new stuff available for
searching. If you're just loading stuff into an index that isn't serving
searches, there's no benefit to committing before everything is loaded;
it just slows things down.
Assuming your data structures are the same and you're not talking
millions of records, I'd be inclined to put everything in one index to
make cross-searching easier, assuming you want cross-searching. If you
don't, there's no reason not to have multiple indexes.
There is a way to pass Solr a path to a file that it can read from disk
rather than posting the file. I hunted a bit in the wiki and couldn't
find it, though; it may still be a patch you have to apply.
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of
Sent: Thursday, November 22, 2007 1:03 AM
To: [log in to unmask]
Subject: [CODE4LIB] Getting started with SOLR
I am just getting my feet wet with SOLR and have a couple of question
how others have done certain things.
I created a schema.xml where basically every field is of type "text" for
the beginning. Do you use specialized types for authors or ISBNs or
How do you handle multi-value fields? Do you feed everything in a single
field (like "Smith, James ; Miller, Steve" as I have seen in a pure
Lucene implementation of a collegue or do you use the multiValued
feature of SOLR?
What about boosting? I thought of giving the current year a boost="3.0"
and then 0.1 less for every year the title is older, down to 1.0 for a
21-year-old book. The idea is to have a sort that tends to promote
recent titles but still respects other aspects. Does this sound
reasonable or are there other ideas? I would be very interested in an
actual boosting-scheme from where I could start.
We have a couple of databases that should eventually indexed. Do you
build one huge database with an additional "database" field or is it
better to have every database in its own SOLR instance?
How do you fill the index? Our main database has about 700,000 records
and I don't know if I should build one huge XML-file and feed that into
SOLR or use a script that sends one record at a time with a commit after
every 1000 records or so. Or do something in between and split it into
chunks of a few thousand records each? What are your experiences? What
if a record gives an error? Will the whole file be recjected or just
that one record?
Are there alternatives to the HTTP gateway?
Are there any Perl-scripts around that could help? I built a little
script that uses LWP to feed my test records into the database. It works
but I don't have any error handling yet, very Quick and dirty XML
creation so if there is something more mature I would like to use that.
Any other ideas, further reading, experiences...?
I know these are a lot of questions but after the conference last year I
think there is lots of expertise in this group and perhaps I can avoid a
few beginner mistakes with your help
thanks in advance