You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Ajay Upadhyaya <aj...@gmail.com> on 2005/03/03 22:53:21 UTC
renaming fields in index
Hi,
We have large number of documents which are indexed(approx 1M), the
size of the index is approx 1G. . We have few Keyword fields as well
as few UnStored fields.
Now there is a requirement to change names of few fields. The
application code can be easily changed to created the new document
with new field names but existing documents have to be migrated to
have new field names, so the query on new names can find them. What
could be the easiest & fastest way to do this.
Thanks,
Ajay
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: renaming fields in index
Posted by Doug Cutting <cu...@apache.org>.
Andrzej Bialecki wrote:
> Doug Cutting wrote:
>
>> You cannot easily change the field names in the index.
>
> ..through the existing API, that is. Because you can change the content
> of the *.fnm file appropriately, right?
Right. One could write something that would re-write all of the .fnm
files. It would need to check that you don't try to rename two fields
to be the same (since that would require re-writing the full segment).
It would also need to lock segments for write.
Doug
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: renaming fields in index
Posted by Andrzej Bialecki <ab...@getopt.org>.
Doug Cutting wrote:
> Ajay Upadhyaya wrote:
>
>> We have large number of documents which are indexed(approx 1M), the
>> size of the index is approx 1G. . We have few Keyword fields as well
>> as few UnStored fields.
>>
>> Now there is a requirement to change names of few fields. The
>> application code can be easily changed to created the new document
>> with new field names but existing documents have to be migrated to
>> have new field names, so the query on new names can find them. What
>> could be the easiest & fastest way to do this.
>
>
> You cannot easily change the field names in the index.
..through the existing API, that is. Because you can change the content
of the *.fnm file appropriately, right?
--
Best regards,
Andrzej Bialecki
___. ___ ___ ___ _ _ __________________________________
[__ || __|__/|__||\/| Information Retrieval, Semantic Web
___|||__|| \| || | Embedded Unix, System Integration
http://www.sigram.com Contact: info at sigram dot com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: renaming fields in index
Posted by Doug Cutting <cu...@apache.org>.
Ajay Upadhyaya wrote:
> We have large number of documents which are indexed(approx 1M), the
> size of the index is approx 1G. . We have few Keyword fields as well
> as few UnStored fields.
>
> Now there is a requirement to change names of few fields. The
> application code can be easily changed to created the new document
> with new field names but existing documents have to be migrated to
> have new field names, so the query on new names can find them. What
> could be the easiest & fastest way to do this.
You cannot easily change the field names in the index.
You can either:
1. Rebuild your index with the new field names, or;
2. Keep the old field names in the index, and translate new field names
in queries to the old field names. Users don't need to know what the
field names are in the index.
Doug
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org