I am trying to write a custom analyzer , whose execution is determined by the value of another field within the document.
For example if the locale field in the document has 'de' as the value, then the analizer would use the German set of tokenizers/filters to process the value of a field. My question is : how can a custom analyzer access the value of another field (in this case locale field) within a document, while analyzing the value of a specific field? There is a solution where we can prepend the locale value to the field's value like de|fieldvalue then custom analyzer can extract the locale while analyzing the field value. This seems a dirty solution. Is there any better solution ?