lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Earwin Burrfoot <>
Subject Re: Document aware analyzers was Re: deprecating Versions
Date Wed, 01 Dec 2010 21:03:36 GMT
I agree with Robert that minimizing analysis <-> indexer interface is
the way to go.
For me, one of Lucene's problems is that it wants to do too much stuff
out of the box, and is tightly coupled, so you can't drop much of the
things you never need.

Having minimal interface for the indexer allows us to experiment with
various analysis approaches without touching core functionality at
I.e. - I'd like to make analysis chain non-streaming. This will
greatly simplify much of my filters, and for my use-case likely yields
more performance.
At the same time I understand that many people can't afford keeping
their docs completely in memory while indexing.

My ideal API is unusable for them, wrapping my token buffers to look
like Document+Fieldables+TokenStreams is uuugly.

Having the lowest possible common denominator as indexer interface is
best for both parties.

On Wed, Dec 1, 2010 at 23:44, Grant Ingersoll <> wrote:
> On Dec 1, 2010, at 2:40 PM, Robert Muir wrote:
>> On Wed, Dec 1, 2010 at 2:25 PM, Grant Ingersoll <> wrote:
>>> Nah, I just meant analysis would often benefit from having knowledge of the document
as a whole instead of just the individual field.
>> and analysis would suffer from this too, because right now these
>> things are independent and we have a fast simple reusable model.
>> I'd prefer to keep the TokenStream analysis api... but as we have
>> discussed on the list, it would be nice to minimize the interface
>> between analysis components and indexer/queryparser so you can use an
>> *alternative* API... we are working in this direction already.
> I think the existing TokenStream API still works, at least in my mind.
>>>> Maybe if you give a concrete example then I would have a better
>>>> understanding of the problem you think this might solve.
>>> Let me see if I can put some flesh on the bones.  I'm assuming the raw document
has already been parsed and that we are still basically dealing with strings and that we have
a document which contains one or more fields.
>>> If we step back and look at our analysis process, there are some things that
are easy and some things that are hard that maybe shouldn't be because even though we talk
like we are indexing and search documents, we are really indexing and searching fields and
everything is Field centric.  That works fine for the easy analysis things like tokenization,
stemming, lowercasing, etc. when all the content is in one language.  It doesn't work well
when you have multiple languages in a single document or if you want to do things like Tee/Sink
or even something as simple as Solr's copy field semantics.
>> Well i have trouble with a few of your examples: "want to use
>> Tee/Sink" doesn't work for me... its a description of an XY problem to
>> me... i've never needed to use it, and its rarely discussed on the
>> user list...
> Shrugs.  In my experiments, it can really speed things up when analyzing the same content,
but with different outcomes, or at least it did back before the new API.  My bigger point
is things like that and the PerFieldAnalyzerWrapper are symptoms of treating documents as
second class citizens.
>> As far as working with a lot of languages, i understand this issue
>> much more... but i've never much had a desire for this, especially
>> given the fact that "Query is a document too"... I'm personally not a
>> fan of language detection,
>> and I don't think it belongs in our analysis API: like encoding
>> detection and other similar heuristics, its part of document parsing
>> to me!
> I didn't say it did, I just said it is an example of the types of things where we pretend
like we are document-centric, but we are actually field centric.
>> As I said before, I think our TokenStream analysis API is already
>> quite complicated and I dont think we should make it more complicated
>> for these reasons (especially since these examples are quite vague and
>> i'm still not sure you cannot solve them easier in another way.
> I never said you couldn't solve them in other ways, but I always find they are kludgy.
 For instance, how many times, in a complex environment, must one tokenize the same text
over and over again just to get it in the index?
>> If you want to use a more complicated analysis API that doesnt work
>> like TokenStreams but instead incorporates things that are document
>> parsing or whatever, i guess you should be able to do that. I'm not
>> sure Lucene should provide such an API, but we shouldn't force you to
>> use the TokenStreams API either.
> You keep going back to document parsing, even though I have never mentioned it.  All
I am proposing/_wanting to discuss_ is the notion that Analysis might benefit from a more
document centric view of analysis.  You're presupposing I want to change TokenStreams, etc.
when all I'm wanting to do is take a step back and discuss the bigger picture of how a user
actually does analysis in the real world and whether we can make it easier for them.  I don't
even have an implementation in mind yet.
> For instance, the typical copy field scenario where one has two fields containing the
same content analyzed in slightly different ways.  In many cases, most of the work is exactly
the same (tokenize, lowercase, stopword, stem or not) and yet we have to pass around the string
twice and do almost all of the same work twice all so that we can change one little thing
on the token.
> -Grant
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Kirill Zakharenko/Кирилл Захаренко (
Phone: +7 (495) 683-567-4
ICQ: 104465785

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message