lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 안재희[Jade] <jaehee....@nhn.com>
Subject Have Anyone Needed a Method, getAnalyzer(String fieldName) of PerFieldAnalyzerWrapper Class, So Far?
Date Fri, 16 Dec 2011 08:25:18 GMT
Hello~
Have anyone needed a method, getAnalyzer(String fieldName) of PerFieldAnalyzerWrapper class,
so far?
A method getDefaultAnalyzer() as well. 
 
It is useful in my project.
The needs would be unusual, though. Implementing these methods is very simple.
 
Does Apache Lucene have any plan to add these methods? Please Let me know about it.

Anyway,I created a new temporary class named "PerFieldAnalyzerWrapper2", having coped and
pasted the PerFieldAnalyzer codes and added two methods as I mentioned above, just like below.
 
{code}
 
/** Using the instance varialbes of Apache Lucene PerFiledAnalyzerWrapper **/
private Analyzer defaultAnalyzer;
private Map&lt;String,Analyzer&gt; analyzerMap = new HashMap&lt;String,Analyzer&gt;();
/****/
 
public Analyzer getAnalyzer(String fieldName) {
  Analyzer analyzer = getDefaultAnalyzer(); 
  if (analyzerMap.containsKey(fieldName)) {
   
   analyzer = analyzerMap.get(fieldName);       
  }
  return analyzer;
 }
 
 public Analyzer getDefaultAnalyzer() {
 
  return defaultAnalyzer;
 }
 
{code} 
 
It is very simple, but I hope I could avoid an extra code sustaining in my project source
tree. 
 
Thank you.
 
Jade.
 
안재희 드림.



이 메일은 나눔글꼴로 작성되었습니다. 설치하기

 안재희  Ahn Jaehee
 웹플랫폼개발랩 / 사원
  경기도 성남시 분당구 서현동 266-1 분당퍼스트타워 13층 463-824 
Tel 031-600-3776   Fax 031-784-1800   Mobile 010-9434-8412 
Email  jaehee.ahn@nhn.com 
사람과 사람, 오늘과 내일, 네트워크와 네트워크가 연결되는 더 큰 세상,
NHN이 만들어 갑니다.

       

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message