On Sat, Dec 4, 2010 at 6:05 PM, Teruhiko Kurosaka wrote:
> Thank you, Robert, substituting getAttribute with addAttribute worked!
>
> But I don't understand why. Could you help me to understand the mechanics?
>
> In my setting,
> hasAttribute(PayloadAttribute.class) returns false.
>
> So I though
All tokenfilters/tokenizers in a chain share the same attributes. When you
add an attribute to one of them, they all share the same instance. That's
the whole trick behind the analysis API. getAttribute() should only be used
in conditional code, that check with has Attribute before. But In general,
Thank you, Robert, substituting getAttribute with addAttribute worked!
But I don't understand why. Could you help me to understand the mechanics?
In my setting,
hasAttribute(PayloadAttribute.class) returns false.
So I thought addAttribute(PayloadAttribute.class) would just
create a new PayloadA