You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucy.apache.org by goran kent <go...@gmail.com> on 2011/09/08 15:53:58 UTC
[lucy-user] Lucy questions wrt production, ranking, etc
Hi,
Early-adopter here.
I'm considering Lucy for a new project (and I must say, the docs are
nice and it's Perl/C which is always welcome in this day and age).
So,... I gather from the mailing list that it's production ready, but
officially API-unstable. Does API-unstable mean the index format may
change any time soon, eg, before the first stable release?
The environment is distributed search across a cluster with the intent
of keeping search-time sub-second - 3s at most (folks are spoilt by
the elephant in the industry, so they lose interest if the page does
not return in that time).
I see from the docs that distributed search is supported, else it
would be a non-starter.
Ranking
-------
I need to sort results based on a floating point value (actually
several). I see Lucy supports this. By how much does custom sorting
impact search performance?
What about term proximity in documents? Will a matching document rank
higher than another if two (or whatever being searched for) terms are
physically located closer together? Or is ranking based only on a
term count ignoring positional info?
What if the matching terms are physically closer to the TOP of the document?
Does Lucy consider the relative importance of the search terms
themselves? For example, searching for [a b c d] would imply that
those terms' importance declines from left to right, with 'a' being
the most important, etc. I think there was a Page/Brin paper on this
somewhere on the 'tubes.
Phrase searches
---------------
I see this is supported. Hard to quantify, I know, but by what factor
is phrase-searching slower than an equivalent term search?
Spelling suggestions
--------------------
I may have missed this one in the docs: does Lucy support suggested
spelling (a-la Google). One could always use a dictionary, but it
would be nice if Lucy built up a dictionary based on the terms
encountered during indexing.
Merging/optimization
--------------------
Merging multiple indexes into larger ones is supported. I see there
is also an 'optimize' for faster searching; can one update an index
with newer pages after such an optimization, or is it a one-way
street?
Index checking/verification
---------------------------
In a cluster environment all kinds of things go wrong on a weekly
basis - when this happens during indexing or merging indexes can be
left in a broken state leading to problems in batch processing. Does
Lucy have an index-verifier (a-la fsck) to scan an index and report
errors (not fix, just check and report)?
Which version?
--------------
With index format stability being important, which version should I
consider using? 0.2.x incubating, or trunk?
Language/binding
----------------
I see Perl can be used during indexing/searching, how about PHP on the
search side? Presumably PHP bindings (for search-related bindings at
least) are on the horizon/done? Not that important, just wondering.
Scale
-----
Anyone using Lucy on a sizeable index split across nodes in a cluster?
By sizeable I mean > 1-2TB. If so, how's your search times (yes, I
know, it depends on
caching/memory/IO/CPUs/#nodes)?
Any comments would be appreciated.
g
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Fri, Sep 09, 2011 at 08:47:20AM +0200, goran kent wrote:
> Just to clarify - is obtaining excerpts from a distributed search a
> problem? One would think irrespective of whether you're performing a
> local or distributed search the modus operandi would be the same
> (without coding gymnastics required to glue things together to work as
> expected).
Not a problem.
The Highlighter API requires a Lucy::Search::Searcher.
my $highlighter = Lucy::Highlight::Highlighter->new(
searcher => $searcher, # must be a Lucy::Search::Searcher
query => $query,
field => 'content',
);
Lucy::Search::IndexSearcher and Lucy::Search::PolySearcher are both Searcher
subclasses, as is LucyX::Remote::SearchClient for that matter. Any of them
will work.
Marvin Humphrey
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by goran kent <go...@gmail.com>.
Thanks for the quick response Nathan! See question below.
On Thu, Sep 8, 2011 at 9:58 PM, Nathan Kurz <na...@verse.com> wrote:
>
>> The environment is distributed search across a cluster with the intent
>> of keeping search-time sub-second - 3s at most (folks are spoilt by
>> the elephant in the industry, so they lose interest if the page does
>> not return in that time).
>>
>> I see from the docs that distributed search is supported, else it
>> would be a non-starter.
>
> This excites me too, but I don't know that anyone is pushing it's
> limits yet. But architecturally, I think it's well designed to allow
> really fast clusters of in-ram search. Talking about 3 seconds makes
> it sound like you're willing to hit disk: you might need some intense
> tuning here, depending on how you deal with really common stopwords.
> Also, there are some limitations with custom sort ordering and the
> like: clusters are going to deal better with floating point than with
> alphabetical, for example, and
> ... excerpts might be a little clunky to
> retrieve. Currently it's just a DocID and a score that get returned
> efficiently.
Just to clarify - is obtaining excerpts from a distributed search a
problem? One would think irrespective of whether you're performing a
local or distributed search the modus operandi would be the same
(without coding gymnastics required to glue things together to work as
expected).
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by Nathan Kurz <na...@verse.com>.
On Thu, Sep 8, 2011 at 6:53 AM, goran kent <go...@gmail.com> wrote:
> Hi,
>
> Early-adopter here.
>
> I'm considering Lucy for a new project (and I must say, the docs are
> nice and it's Perl/C which is always welcome in this day and age).
Hi Goran, and welcome to Lucy! I'll jump in to give you some
preliminary answers. I'm familiar with the code base, but out of
touch with some of the recent development. So I should be able to
give you answers that are basically right, but I might mangle some
important details due to recent changes. But I trust that someone
else will jump in to correct those parts soon enough.
> So,... I gather from the mailing list that it's production ready, but
> officially API-unstable. Does API-unstable mean the index format may
> change any time soon, eg, before the first stable release?
No, I'm not sure what the official claim is, but it's unlikely that
index format will change enough to hurt you. Rather than having a
single monolithic index format, Lucy allows multiple formats to
coexist. The index format should be stable through release. And due
to the class structure, even if the mainline changes, it should be
possible to have back compatibility for as long as you need it.
> The environment is distributed search across a cluster with the intent
> of keeping search-time sub-second - 3s at most (folks are spoilt by
> the elephant in the industry, so they lose interest if the page does
> not return in that time).
>
> I see from the docs that distributed search is supported, else it
> would be a non-starter.
This excites me too, but I don't know that anyone is pushing it's
limits yet. But architecturally, I think it's well designed to allow
really fast clusters of in-ram search. Talking about 3 seconds makes
it sound like you're willing to hit disk: you might need some intense
tuning here, depending on how you deal with really common stopwords.
Also, there are some limitations with custom sort ordering and the
like: clusters are going to deal better with floating point than with
alphabetical, for example, and excerpts might be a little clunky to
retrieve. Currently it's just a DocID and a score that get returned
efficiently.
> Ranking
> -------
> I need to sort results based on a floating point value (actually
> several). I see Lucy supports this. By how much does custom sorting
> impact search performance?
Depends on the complexity of your algorithm, but probably minimally.
If you are touching disk, that will dominate everything. If not, you
will be Memory IO bound but have lots of excess CPU available to
crunch the numbers.
> What about term proximity in documents? Will a matching document rank
> higher than another if two (or whatever being searched for) terms are
> physically located closer together? Or is ranking based only on a
> term count ignoring positional info?
>
> What if the matching terms are physically closer to the TOP of the document?
It's doesn't do this particularly well currently. Currently TF/IDF
scoring is pretty much be-all and end-all for the built in ranking.
But adding or changing to the approach you mention has long been a
design goal, should be supported by the architecture, and is just
waiting for the right person with the right itch. You'll probably
have to write your own scoring algorithms, but they should slot in
quite well once you understand the way Lucy works.
> Does Lucy consider the relative importance of the search terms
> themselves? For example, searching for [a b c d] would imply that
> those terms' importance declines from left to right, with 'a' being
> the most important, etc. I think there was a Page/Brin paper on this
> somewhere on the 'tubes.
Not by default. It does support term weighting, though, and it's very
easy to change the way that Queries are produced from the input text.
In general, creating custom scorers is involved and will require a
fairly deep understanding of the architecture, but changing the way
that Queries are parsed is easy and self-contained. Might be a good
first project with Lucy.
> Phrase searches
> ---------------
> I see this is supported. Hard to quantify, I know, but by what factor
> is phrase-searching slower than an equivalent term search?
Hard to quantify, but fast. Probably even "really fast", since it
short circuits efficiently. Depending on how common the terms are,
searching for "A B" as a phrase is probably 25% more efficient than
searching for (A B) as independent terms. Adding proximity other
than "next word" would slow things considerably, but I wouldn't be
afraid of pushing phrases hard.
> Spelling suggestions
> --------------------
> I may have missed this one in the docs: does Lucy support suggested
> spelling (a-la Google). One could always use a dictionary, but it
> would be nice if Lucy built up a dictionary based on the terms
> encountered during indexing.
The dictionary exists, but I don't think there is a good standard API
for accessing it for this purpose. This is a case where the warning
about API changes might matter. But it's so easy to access, that once
you have a good way to do it you might be able to propose it as part
of the standard. Or maybe this has already been done?
> Merging/optimization
> --------------------
> Merging multiple indexes into larger ones is supported. I see there
> is also an 'optimize' for faster searching; can one update an index
> with newer pages after such an optimization, or is it a one-way
> street?
I think currently everything can still be updated. Lucy makes it easy
to treat multiple index segments as one, and then to later merge them
to actually be one. Adding another segment after the merge for new
data should be fine. I think you can rinse and repeat as desired.
> Index checking/verification
> ---------------------------
> In a cluster environment all kinds of things go wrong on a weekly
> basis - when this happens during indexing or merging indexes can be
> left in a broken state leading to problems in batch processing. Does
> Lucy have an index-verifier (a-la fsck) to scan an index and report
> errors (not fix, just check and report)?
I don't think there is a built-in, but I'm pretty sure it exists at
the testing level. Should be easy to rig up what you want out of the
parts if you don't find it in the box.
> Which version?
> --------------
> With index format stability being important, which version should I
> consider using? 0.2.x incubating, or trunk?
Ask Marvin to be sure, but I'd suggest Trunk. I don't think index
format is going to have any major upheavals before release, and there
may be some things you do that are worth contributing back to the main
line. This project is really quite conservative, and rarely are
there API changes that affect anyone who sticks to the official
interface.
> Language/binding
> ----------------
> I see Perl can be used during indexing/searching, how about PHP on the
> search side? Presumably PHP bindings (for search-related bindings at
> least) are on the horizon/done? Not that important, just wondering.
On the horizon, and waiting for someone with PHP/C integration
experience to take it on. It's on a par with plans for Ruby and
Python support. It's anticipated, no major hurdles are forseen, but
it will take considerable work by someone with familiarity with both
Lucy and the language in question.
> Scale
> -----
> Anyone using Lucy on a sizeable index split across nodes in a cluster?
> By sizeable I mean > 1-2TB. If so, how's your search times (yes, I
> know, it depends on
> caching/memory/IO/CPUs/#nodes)?
I've thought it through a few times, but haven't actually run
anything. My guess is that 1-2TB is easily achievable. At this
level, I think you could probably get sub-second response time by
just putting the full index on a single machine with 128G RAM and some
SSD's, then replicate setups as needed until you have the throughput
you need. Or build a cluster with 2-4TB of RAM shared between them,
never touch disk, and the cluster should fly.
Lucy is designed to be very memory efficient, so if you can come
anywhere close to fitting your index in RAM (whether on one machine or
many) you should be as fast (faster?) than anything out there. It's
when you get closer to the PB scale, when you are trying to trade off
seconds of disk transfer latency with hundreds of requests per second
that you'll really need to get really creative.
Now for someone to step in and correct my gaffes,
Nathan Kurz
nate@verse.com
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by goran kent <go...@gmail.com>.
On Fri, Sep 9, 2011 at 4:24 AM, Peter Karman <pe...@peknet.com> wrote:
>> Spelling suggestions
>> --------------------
>> I may have missed this one in the docs: does Lucy support suggested
>> spelling (a-la Google). One could always use a dictionary, but it
>> would be nice if Lucy built up a dictionary based on the terms
>> encountered during indexing.
>
> As Marvin notes, Lucy does not have this built in. You could use
> Search::Tools::Spellcheck (also on CPAN) to do this though, and it would be
> pretty straightforward to build a Aspell dictionary based on a Lucy lexicon, I
> imagine.
Search::Tools::Spellcheck - thanks, I'll look into that one and see
whether it's use doesn't impose a search-time performance penalty.
Searching itself should be the slowest - this is expected. All
support functionality (excerpt, highlighting, spelling, etc) must not
even raise a hair above the response-time event-horizon, so to speak
:)
Thanks for your feedback!
regards
g
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by Peter Karman <pe...@peknet.com>.
goran kent wrote on 9/8/11 8:53 AM:
> Hi,
>
> Early-adopter here.
>
Welcome!
> Does Lucy consider the relative importance of the search terms
> themselves? For example, searching for [a b c d] would imply that
> those terms' importance declines from left to right, with 'a' being
> the most important, etc. I think there was a Page/Brin paper on this
> somewhere on the 'tubes.
The native query parser doesn't support this, as Marvin noted. You might look at
Search::Query::Dialect::Lucy on CPAN, as that would allow you to manipulate
query strings into Lucy objects easily, and then boost terms based on query
position.
>
> Spelling suggestions
> --------------------
> I may have missed this one in the docs: does Lucy support suggested
> spelling (a-la Google). One could always use a dictionary, but it
> would be nice if Lucy built up a dictionary based on the terms
> encountered during indexing.
As Marvin notes, Lucy does not have this built in. You could use
Search::Tools::Spellcheck (also on CPAN) to do this though, and it would be
pretty straightforward to build a Aspell dictionary based on a Lucy lexicon, I
imagine.
> Language/binding
> ----------------
> I see Perl can be used during indexing/searching, how about PHP on the
> search side? Presumably PHP bindings (for search-related bindings at
> least) are on the horizon/done? Not that important, just wondering.
I have on my TODO list to work on PHP host language implementation, but a C
implementation is higher on my list.
That said, I will probably write a PHP REST client for Dezi (a Solr-like project
built on top of Lucy) before either of the above, since I have $work interests
in that.
--
Peter Karman . http://peknet.com/ . peter@peknet.com
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Sat, Sep 10, 2011 at 06:50:52PM +0200, goran kent wrote:
> Hmm, my sort floats are typically like this:
>
> min: 0.1254619125
> max: 3117.88289166118
> typical: 0.231372871201865 (15 dec places max)
>
> sprintf("%0.15f") in Perl produces:
>
> 0.125461912500000 ok
> 3117.882891661180111 screw up (should be 3117.882891661180000)
> 0.231372871201865 ok
>
> I imagine the large value 3117 with the added "0111" won't present a
> problem when sorting -- but I have a feeling I'm wrong, right?
;)
Sure, add the value "8.8" to the mix and you're in trouble, because it will
sort last:
$ perl -MData::Dumper -le 'my @stuff = ("0.125461912500000", "3117.882891661180111", "0.231372871201865", "8.8"); warn Dumper([sort @stuff])'
$VAR1 = [
'0.125461912500000',
'0.231372871201865',
'3117.882891661180111',
'8.8'
];
You need to change the format argument from "%0.15f" to something like
"%023.15f" to get a minimum number of total characters (the decimal point is
included in the count) and to fill with leading zeros.
$ perl -MData::Dumper -le 'my @stuff = map {sprintf "%023.15f", $_} ("0.125461912500000", "3117.882891661180111", "0.231372871201865", "8.8"); warn Dumper([sort @stuff])'
$VAR1 = [
'0000000.125461912500000',
'0000000.231372871201865',
'0000008.800000000000001',
'0003117.882891661180111'
];
Watch out, though -- you have to know the range in advance in order to choose
the format so that you don't overflow. Effectively what we're doing is
converting a floating point representation to "fixed point", and fixed point
cannot represent the same range as floating point without occupying a lot more
space.
Marvin Humphrey
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by goran kent <go...@gmail.com>.
On Sat, Sep 10, 2011 at 4:25 AM, Marvin Humphrey <ma...@rectangular.com> wrote:
> You must stringify during indexing.
>
> Here's example indexing code where both the "date" and "rainfall" fields are
> prepared using sprintf() so that they will sort in the desired order:
>
> my %doc = (
> location => $location,
> date => sprintf("%0.4d-%0.2d-%0.2d", $year, $month, $day),
> rainfall => sprintf("%07.4f", $cm_rainfall), # e.g. 01.1482
> );
> $indexer->add_doc(\%doc);
>
> Of course you have to choose an adequate precision so you don't overflow and
> screw up the sort order. :)
Hmm, my sort floats are typically like this:
min: 0.1254619125
max: 3117.88289166118
typical: 0.231372871201865 (15 dec places max)
sprintf("%0.15f") in Perl produces:
0.125461912500000 ok
3117.882891661180111 screw up (should be 3117.882891661180000)
0.231372871201865 ok
I imagine the large value 3117 with the added "0111" won't present a
problem when sorting -- but I have a feeling I'm wrong, right?
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Fri, Sep 09, 2011 at 09:03:55AM +0200, goran kent wrote:
> On Thu, Sep 8, 2011 at 10:05 PM, Marvin Humphrey <ma...@rectangular.com> wrote:
> > If you like, take a look at LucyX::Remote::SearchServer and
> > LucyX::Remote::SearchClient. They're implemented in pure Perl, so Perl
> > programmers generally find them easier to grok than other parts of the
> > library.
>
> Presumably though the Perl interface is calling the super-fast C
> library so there's no performance penalty, right?
Correct -- the LucyX::Remote classes are just small RPC wrappers.
> > Lucy supports sorting on the lexical value of text fields. You can use
> > sprintf() or the like to stringify floats so that field values sort lexically
> > in the same order as they would numerically.
>
> Ignorant question: stringify during indexing, or searching?
You must stringify during indexing.
Here's example indexing code where both the "date" and "rainfall" fields are
prepared using sprintf() so that they will sort in the desired order:
my %doc = (
location => $location,
date => sprintf("%0.4d-%0.2d-%0.2d", $year, $month, $day),
rainfall => sprintf("%07.4f", $cm_rainfall), # e.g. 01.1482
);
$indexer->add_doc(\%doc);
Of course you have to choose an adequate precision so you don't overflow and
screw up the sort order. :)
> 1. Since my search results are always ranked by my own sort-field,
> does Lucy skip unimportant docs - ie those with too-low sort-score,
> unless minimum results are not found?
I'm not sure what kind of an optimization you have in mind, but Lucy doesn't
really skip docs in the way that you're describing.
During searching, Lucy proceeds from matching doc id to matching doc id.
Matches are deposited into a Collector; if the Collector requires a score,
then a score will be calculated for each matching doc as needed.
The Collector which gets used 99% of the time is a SortCollector, which keeps
matches in a priority queue. Poor matches either fall out the bottom of the
queue, or once the queue is full, fail to displace an existing match.
By the time we determine that a match wasn't good enough to keep, we've
already most of the work. So I think the answer to your question is: no, Lucy
does not "skip unimportant docs". There are optimizations in place which
"skip" certain chunks of index data, but they are concerned with lowering the
cost of proceeding from match to match, not with hopping over "unimportant"
matches.
> 2. Highlighting - does it use regex, perl, or pure-C - I've found in
> some libraries that highlighting can impact heavily on performance.
> ie, search returns sub-second, but building the snippets and
> highlighting for a typical 25-50 item page can take 0.5s - second or
> more on it's own (particularly if there are hundreds of highlighted
> terms).
Lucy's highlighter is coded in C and uses positional information built up at
index time.
> 3. Short-circuiting search: let's say the index has 100m docs.
> Since I only intend ever displaying a max of (say) 500 results (broken
> into pages of 10/25/50 each), does Lucy grind away at the entire index
> to proudly let me know that it found 50,000 results, even though I'm
> only displaying a small subset, or does it take cognizance of my
> intent to only display 500, find the top 500 (eg, based on my custom
> sort field which is a relevance-indicator), but still report that it
> "found" 50,000 (ie, 50k possible results) results? Sorry, I know this
> is a rather staggered/not-well-presented question, so I hope I made
> sense.
The algorithm I think you're reaching for is sometimes called "early
termination". The way it works is that you have the Collector throw an
exception once the desired number of documents have been collected to break
out of the collection loop and you have the Searcher catch that exception.
However, I think I spy a difficulty in your specification: you want to "find
the top 500" documents, but you don't want to search all documents. If you
stop early, how do you know that no document yet to come scores higher than
the ones you've seen so far?
The general approach that people take with early termination is to ensure that
documents are iterated from "most important" to "least important" when
searching. That means controlling the order in which they appear in the
index -- for instance by queueing documents according to pagerank prior to
indexing. The limitations of such an approach are:
1) It is not friendly to index updates.
2) You can only pre-sort the index on *one* sort criteria.
Marvin Humphrey
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by goran kent <go...@gmail.com>.
On Thu, Sep 8, 2011 at 10:05 PM, Marvin Humphrey <ma...@rectangular.com> wrote:
> If you like, take a look at LucyX::Remote::SearchServer and
> LucyX::Remote::SearchClient. They're implemented in pure Perl, so Perl
> programmers generally find them easier to grok than other parts of the
> library.
Presumably though the Perl interface is calling the super-fast C
library so there's no performance penalty, right?
>> Ranking
>> -------
>> I need to sort results based on a floating point value (actually
>> several). I see Lucy supports this.
>
> Lucy supports sorting on the lexical value of text fields. You can use
> sprintf() or the like to stringify floats so that field values sort lexically
> in the same order as they would numerically.
Ignorant question: stringify during indexing, or searching?
Thank you for your time in answering my questions, it's appreciated.
If I may steal a few more cycles from you:
1. Since my search results are always ranked by my own sort-field,
does Lucy skip unimportant docs - ie those with too-low sort-score,
unless minimum results are not found?
2. Highlighting - does it use regex, perl, or pure-C - I've found in
some libraries that highlighting can impact heavily on performance.
ie, search returns sub-second, but building the snippets and
highlighting for a typical 25-50 item page can take 0.5s - second or
more on it's own (particularly if there are hundreds of highlighted
terms).
3. Short-circuiting search: let's say the index has 100m docs.
Since I only intend ever displaying a max of (say) 500 results (broken
into pages of 10/25/50 each), does Lucy grind away at the entire index
to proudly let me know that it found 50,000 results, even though I'm
only displaying a small subset, or does it take cognizance of my
intent to only display 500, find the top 500 (eg, based on my custom
sort field which is a relevance-indicator), but still report that it
"found" 50,000 (ie, 50k possible results) results? Sorry, I know this
is a rather staggered/not-well-presented question, so I hope I made
sense.
Thanks!
g
Re: [lucy-user] Lucy questions wrt production, ranking, etc
Posted by Marvin Humphrey <ma...@rectangular.com>.
On Thu, Sep 08, 2011 at 03:53:58PM +0200, goran kent wrote:
> Early-adopter here.
Thanks for considering Lucy for your project. It's true that Lucy's first
Apache release happened only a few months ago -- however, since the code base
that is now Lucy has been in development since 2005 or so, you probably don't
have to worry so much about archetypal early adopter concerns.
> I'm considering Lucy for a new project (and I must say, the docs are
> nice and it's Perl/C which is always welcome in this day and age).
:)
> So,... I gather from the mailing list that it's production ready, but
> officially API-unstable. Does API-unstable mean the index format may
> change any time soon, eg, before the first stable release?
The possibility exists. At this time, there are no incompatible changes
being considered, and given the cost to our users, it's not something we ever
do lightly. However, no one is actively working to prepare a stable release,
either. Development is presently focusing on making Lucy available from
languages other than Perl.
> I see from the docs that distributed search is supported, else it
> would be a non-starter.
If you like, take a look at LucyX::Remote::SearchServer and
LucyX::Remote::SearchClient. They're implemented in pure Perl, so Perl
programmers generally find them easier to grok than other parts of the
library.
> Ranking
> -------
> I need to sort results based on a floating point value (actually
> several). I see Lucy supports this.
Lucy supports sorting on the lexical value of text fields. You can use
sprintf() or the like to stringify floats so that field values sort lexically
in the same order as they would numerically.
(I'm not sure how deep your investigations have gone, but if you are referring
to numeric FieldTypes: the underlying machinery is there, but it has not been
made public, and should be considered experimental and subject to change.)
> By how much does custom sorting impact search performance?
Search-time performance of sorting by field value is tyically *faster* than
sorting by relevance.
We build optimized structures at index-time (arrays of ordinals mapping doc
ids to rank order), then mmap() those data structures at search-time. Because
mmap is near instantaneous, opening a new Searcher is very quick, and new data
can be available for searching almost immediately after a commit completes.
Enabling sorting has negligible impact on opening a Searcher, even for large
indexes with many sortable fields.
Then, during the actual search, looking up an ordinal in array is usually
faster than calculating a score.
> What about term proximity in documents? Will a matching document rank
> higher than another if two (or whatever being searched for) terms are
> physically located closer together? Or is ranking based only on a
> term count ignoring positional info?
Ranking does not consider positional info. This was discussed on lucy-dev a
couple weeks ago:
http://markmail.org/message/3lmsixphxyrjveta
> Does Lucy consider the relative importance of the search terms
> themselves? For example, searching for [a b c d] would imply that
> those terms' importance declines from left to right, with 'a' being
> the most important, etc. I think there was a Page/Brin paper on this
> somewhere on the 'tubes.
It would be possible to write a query parser which does this, but it is not
built into the default parser.
> Phrase searches
> ---------------
> I see this is supported. Hard to quantify, I know, but by what factor
> is phrase-searching slower than an equivalent term search?
Ironically, not that much. That's actually because positions are iterated
while performing an ordinary term search (they are inlined into the posting
format). Once that is changed, term queries will be sped up and the gap will
widen.
> Spelling suggestions
> --------------------
> I may have missed this one in the docs: does Lucy support suggested
> spelling (a-la Google). One could always use a dictionary, but it
> would be nice if Lucy built up a dictionary based on the terms
> encountered during indexing.
No, Lucy does not provide spelling suggestion facilities.
> Merging/optimization
> --------------------
> Merging multiple indexes into larger ones is supported. I see there
> is also an 'optimize' for faster searching; can one update an index
> with newer pages after such an optimization, or is it a one-way
> street?
The word "optimize" is largely vestigial. It doesn't do much, if anything, to
improve search-time performance. It certainly doesn't freeze an index and
prevent you from making subsequent modifications.
> Index checking/verification
> ---------------------------
> In a cluster environment all kinds of things go wrong on a weekly
> basis - when this happens during indexing or merging indexes can be
> left in a broken state leading to problems in batch processing. Does
> Lucy have an index-verifier (a-la fsck) to scan an index and report
> errors (not fix, just check and report)?
No such tool is bundled. I agree that it would be nice to have, and at $work
we have our own internal version of such a tool. However, FWIW, we've been
running hundreds of indexes spread out across tens of machines for a couple
years now, and random index corruption has not been something we've had to
deal with. (Our tool checks for logical data consistency, not file
integrity.)
> Which version?
> --------------
> With index format stability being important, which version should I
> consider using? 0.2.x incubating, or trunk?
As far as index compatibility goes, there's no difference. Nothing has
changed.
While we haven't put this to the test, Lucy will theoretically read old
KinoSearch 0.3x indexes, despite the namespace change. These are the only
backwards breaks we've made in the last couple years:
* Upgrade the Snowball stemming library (which affected German indexes).
* Disallow "\p" constructs in Tokenizer regexes because of a Perl security
problem affecting untrusted indexes.
* Change the default value for "stored" in BlobType.
We've often made *forwards-incompatible* changes so that you can't roll back
to an older library version, but backwards-incompatible breaks are rare.
> Language/binding
> ----------------
> I see Perl can be used during indexing/searching, how about PHP on the
> search side? Presumably PHP bindings (for search-related bindings at
> least) are on the horizon/done? Not that important, just wondering.
Since we're working on bindings in general, this is getting easier. However,
I don't know of any volunteer with both time and the itch to work on PHP
specifically.
> Scale
> -----
> Anyone using Lucy on a sizeable index split across nodes in a cluster?
> By sizeable I mean > 1-2TB.
I don't know of anyone who is using Lucy with a corpus of that size.
> If so, how's your search times (yes, I know, it depends on
> caching/memory/IO/CPUs/#nodes)?
Lucy's searching is fast, but could be considerably faster. There are a lot
of known approaches which have simply not been applied because no developer
has made search speed a priority recently. I could work on that, but frankly,
it's high-reward work that I would rather someone else got the credit for.
We worked hard on near-real-time search with sorting, so Lucy shines there.
If we get volunteers for whom search speed above and beyond what we have today
is important, we'll shine in that area as well.
Cheers,
Marvin Humphrey