The usual way to accomplish something like this is just use copyField,
perhaps combined with eDismax to automatically search both fields,
perhaps boosting the exact match field much higher.

There are more complex ways of doing this that would involved writing
your own tokenizer, but the above is simplest. Yes it makes a larger
index, but depending on the amount of data you're working with it may
not matter.

Best,
Erick

On Sat, Jul 29, 2017 at 12:01 AM, sandesh.yapuram
<[email protected]> wrote:
> Hello,
> I'm using apache lucene 6.3.0 and I want to index my field 'file_name' using
> 2 Analyzers:
> 1. StandardAnalyzer (to allow search using terms)
> 2. KeywordAnalyzer (to preserve the original name also, just in case if the
> user searches the entire name)
>
>
> Please note that this can be achieved using search time input analysis but I
> want to avoid adding that complexity on the search front of my app.
>
> Or else, is there any way to manually insert a term/string in the Custom
> Analyzer?
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Use-multiple-Analyzers-on-same-field-tp4348165.html
> Sent from the Lucene - Java Developer mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to