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 wgggfiy <wu...@qq.com> on 2013/01/06 08:18:23 UTC
how to add attributes to a field just like term's payload ?
hello, as we know, we can add payload to a term,
but whether can we add extra custom info into a field ?
such the description of the field, which is the property shared by thd field
of all documents.
how to make it ? thx
-----
--------------------------
Email: wuqiu.main@qq.com
--------------------------
--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-add-attributes-to-a-field-just-like-term-s-payload-tp4031045.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: how to add attributes to a field just like term's payload ?
Posted by wgggfiy <wu...@qq.com>.
en ha, sounds good, and perhaps already satisfied my need.
thx so much.
-----
--------------------------
Email: wuqiu.main@qq.com
--------------------------
--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-add-attributes-to-a-field-just-like-term-s-payload-tp4031045p4031122.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: how to add attributes to a field just like term's payload ?
Posted by Simon Willnauer <si...@gmail.com>.
Directory directory = ...
final SegmentInfos sis = new SegmentInfos();
sis.read(directory);
Map<String, String> commitUserData = sis.getUserData();
simon
On Fri, Jan 25, 2013 at 2:32 AM, wgggfiy <wu...@qq.com> wrote:
> hello, but there is no getCommitUserData in IndexReader,
> how can I get the userdata ??
> thx
>
>
>
> -----
> --------------------------
> Email: wuqiu.main@qq.com
> --------------------------
> --
> View this message in context: http://lucene.472066.n3.nabble.com/how-to-add-attributes-to-a-field-just-like-term-s-payload-tp4031045p4036128.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: how to add attributes to a field just like term's payload ?
Posted by wgggfiy <wu...@qq.com>.
hello, but there is no getCommitUserData in IndexReader,
how can I get the userdata ??
thx
-----
--------------------------
Email: wuqiu.main@qq.com
--------------------------
--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-add-attributes-to-a-field-just-like-term-s-payload-tp4031045p4036128.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: how to add attributes to a field just like term's payload ?
Posted by Steve Rowe <sa...@gmail.com>.
Hi wiggify,
Lucene doesn't have direct support for what you want.
However, you can store a custom map in the index when you commit: <
https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/index/IndexWriter.html#commit%28java.util.Map%29
>.
It will be your responsibility to associate that information with each
field, e.g. by using field names as keys in the map.
Steve
On Sun, Jan 6, 2013 at 2:18 AM, wgggfiy <wu...@qq.com> wrote:
> hello, as we know, we can add payload to a term,
> but whether can we add extra custom info into a field ?
> such the description of the field, which is the property shared by thd
> field
> of all documents.
> how to make it ? thx
>