Hi,

 

please ask questions like this on the user lists.

 

But to answer your question: It is common to index the same text in multiple 
fields with different Analyzers (or no Analyzer at all). This is the right 
solution to solve your issue. There is no need to change anything in 
Lucene/Solr because this is how it is designed to work.

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de <http://www.thetaphi.de/> 

eMail: u...@thetaphi.de

 

From: Kamaldeep Singh [mailto:mailkamald...@gmail.com] 
Sent: Monday, March 07, 2016 1:10 PM
To: dev@lucene.apache.org
Subject: Exact matches in phrase queries for terms analyzed using 
StandardAnalyzer

 

Hi,

 

I  have come across an actual use case where I need to do an exact match for a 
term which is indexed as TextField using StandardAnalyzer ie value of term 
"abc" should match to only "abc" and not "abc xyz" . 

 

I understand I can use different analyzer like KeywordAnalyzer and avoid 
converting string to tokens but that is not acceptable since we need to run 
phrase queries with a slop and we can't change analyzer for a single field.

 

One option is definitely storing a copy of that field as StringField and in 
case we want exact matches we could just query that stringfield using TermQuery 
but is there another approach ?

 

Can we consider adding this to lucene if this is not currently supported ? 




Regards,
Kamal

Reply via email to