You could pre-process the field values in an update processor. You can even write a snippet in JavaScript. You could check one field and then redirect a field to an alternate field which has a different analyzer.
What expectations do you have as to what analysis should occur at query time? -- Jack Krupansky On Fri, Mar 27, 2015 at 12:22 PM, Alex Sylka <sylkaa...@gmail.com> wrote: > 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 ? >