Hi Xiaolong,

A Map of key-value pairs can be supplied to
IndexWriter#setCommitData(Map<String,String>) and will be persisted
when committing changes (setting the commit data counts as a change).
It can be retrieved with IndexWriter#getCommitData() later.

This may serve as good storage for metadata; as an example,
Elasticsearch stores attributes related to its transaction log there
(UUID and generation identifier).

Regards,
András

On Tue, Nov 22, 2016 at 5:40 PM, Xiaolong Zheng <zhengxiaol...@gmail.com> wrote:
> Thanks, StoredField seems still down to the per-document level, which means
> for every document they will contains this search field.
>
> What I really would like is a global level storage to hold this single
> value. Maybe this is impossible.
>
> Sincerely,
>
> --Xiaolong
>
>
> On Tue, Nov 22, 2016 at 5:13 AM, Michael McCandless <
> luc...@mikemccandless.com> wrote:
>
>> Lucene won't merge foreign files for you, and in general it's
>> dangerous to put such files into Lucene's index directory because if
>> they look like codec files Lucene may delete them.
>>
>> Can you just add a StoredField to each document to hold your information?
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>>
>> On Mon, Nov 21, 2016 at 11:38 PM, Xiaolong Zheng
>> <zhengxiaol...@gmail.com> wrote:
>> > Hello,
>> >
>> > I am trying to adding some meta data into the search data base. Instead
>> of
>> > adding a new search filed or adding a phony document, I am looking at the
>> > method org.apache.lucene.store.Directory#createOutpu, which is create
>> new
>> > file in the search directory.
>> >
>> >
>> > I am wondering does indexwriter can also merge this non-index file while
>> it
>> > merging multiple search index?
>> >
>> > And if I am stepping back a little bit, what's is the best way to add
>> meta
>> > data into the search database.
>> >
>> > For example, I would like to add a indicator which is showing the
>> different
>> > kind of stemmer is being used while it created.
>> >
>> >
>> >
>> >
>> >
>> > Thanks,
>> >
>> > --Xiaolong
>>

-- 
András Péteri

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

Reply via email to