lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Baudoux ...@taktik.be>
Subject Re: How to rename fields in an index
Date Wed, 22 Aug 2007 15:02:11 GMT
Re-indexing would take a lot of time.


In fact I need this change just for the Query parser class, to be  
able to make queries such as kw:blah. Now my field is called  
"org.mycompany.mediafield.keyword". Not very easy to make queries  
with this field name!


  It would be cool if QueryParser had some sort of field name  
aliasing functionality, so that kw:blah is automatically translated  
into  org.mycompany.mediafield.keyword:blah


Antoine
--
Antoine Baudoux
Development Manager
ab@taktik.be
Tél.: +32 2 333 58 44
GSM: +32 499 534 538
Fax.: +32 2 648 16 53


On 22 Aug 2007, at 16:02, Erick Erickson wrote:

> Unless it's really, really, really prohibitive or impossible,
> I'd recommend regenerating your index. Messing around in
> the low-level file formats is just asking for trouble. Not to
> mention that you'll probably have to remanufcture your
> index sometime, somewhere and hack all over again or
> *hope* that your code changes would match your new
> index. Whereas if you remanufacture with "kw", you'll
> be sure things are consistent
>
> Or worst of all, regenerate the index and have some other
> poor soul try to figure out what the heck is going on with the
> application. "It doesn't work whenever I search on the 'kw' field".
>
> I guess, if I were looking at it, I'd have to say that either
> making a new index so I could use "kw" rather than
> "keyword" was valuable enough to remanufacture the
> index or not valuable enough to do <G>...
>
> Best
> Erick
>
> On 8/22/07, Antoine Baudoux <ab@taktik.be> wrote:
>>
>> Thanks!
>> --
>> Antoine Baudoux
>> Development Manager
>> ab@taktik.be
>> Tél.: +32 2 333 58 44
>> GSM: +32 499 534 538
>> Fax.: +32 2 648 16 53
>>
>>
>> On 22 Aug 2007, at 14:03, Andrzej Bialecki wrote:
>>
>>> Antoine Baudoux wrote:
>>>> No, i just want to change the field labels.
>>>> For example, i have a "Keyword" field that i want to rename into
>>>> "kw".
>>>
>>> (note: this is a low-level hack, you can damage your index beyond
>>> repair).
>>>
>>> Take a look at FieldInfos class, and how it creates the *.fnm file
>>> for each segment. You can re-write these fnm files using new field
>>> names. In case of compound indexes you will need to "explode" them
>>> first to a non-compound format.
>>>
>>> Make sure you write out these files using exactly the same order of
>>> fields, otherwise you will end up in big trouble ;)
>>>
>>>
>>> --
>>> 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-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>
>>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message