Modify how a field value is stored in Lucene

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Modify how a field value is stored in Lucene

Fernando Wasylyszyn
Hi all. This is my question. Currently, I'm working in a project where I have
Lucene documents with one field that use payloads. For this field, I use
org.apache.lucene.analysis.payloads.DelimitedPayloadTokenFilter, so the value
for that field is something like: "fieldValue\1.0" where '\' is the payload
delimiter and "1.0" is the field value payload. The thing is that the values of
this field are stored in the index, so when I retrieve the field value from the
index, I get "fieldValue\1.0" and manually have to remove the payload from the
field value in order to show it to the user, put it in some XML or whatever.
There is any way to modify how a field value is stored in the index as it can be
modified how the value is indexed vía TokenFilters? In this particular case, the
needed modification is remove the payload from the index stored field value, but
there are a lot of cases where something like this could be useful. Thanks in
advance. Cheers.