You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by nischal reddy <ni...@gmail.com> on 2013/09/13 07:12:37 UTC

need Help with lucene attributes

Hi,

I am confused a bit about the lucene attributes, can someone please help me
out with this,

can we store all the attributes of a term in the index?

i have set following attributes for a term, CharacterTermAttribute,
TypeAttribute, PayloadAttribute and OffsetsAttribute, but when i examine my
index with luke i cant find CharTermAttribute and TypeAttribute anywhere in
the index, but i did find payload and offsets.

Are these attributes just used during the analysis time?  wont they be
stored in the index?

My usecase is when i search for a query i want to retrieve all the
attributes that i had set for that term. i am able to retrieve payload and
offsets with DocsAndPositionsEnum instance.

i see that DocsAndPositionsEnum has a method attributes() but it is always
returning null.

Can someone help me out with this, or any other alternative to achieve this.

Thanks,
Nischal Y

Re: need Help with lucene attributes

Posted by Michael McCandless <lu...@mikemccandless.com>.
Hi, I just responded on your previous thread about this ... maybe you
didn't see it (you need to subscribe to java-user@lucene.apache.org to
see responses).

Mike McCandless

http://blog.mikemccandless.com


On Fri, Sep 13, 2013 at 1:12 AM, nischal reddy
<ni...@gmail.com> wrote:
> Hi,
>
> I am confused a bit about the lucene attributes, can someone please help me
> out with this,
>
> can we store all the attributes of a term in the index?
>
> i have set following attributes for a term, CharacterTermAttribute,
> TypeAttribute, PayloadAttribute and OffsetsAttribute, but when i examine my
> index with luke i cant find CharTermAttribute and TypeAttribute anywhere in
> the index, but i did find payload and offsets.
>
> Are these attributes just used during the analysis time?  wont they be
> stored in the index?
>
> My usecase is when i search for a query i want to retrieve all the
> attributes that i had set for that term. i am able to retrieve payload and
> offsets with DocsAndPositionsEnum instance.
>
> i see that DocsAndPositionsEnum has a method attributes() but it is always
> returning null.
>
> Can someone help me out with this, or any other alternative to achieve this.
>
> Thanks,
> Nischal Y

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org