Now that you know how to use each of these tools on their own, we can combine the two classes we've written. We'll use Digester to handle XML parsing, and Lucene to handle indexing. You can see the resulting DigesterMarriesLucene class in Listing 4. (Clicking Listing 4 causes a new browser window to open. Keep that window open so you can refer to Listing 4 while reading the following discussion.)
Let's look at some selections from this class in more detail. Just as we did in the AddressBookIndexer class, we need to open the Lucene index for writing using IndexWriter; we do so here in Listing 5. We pass in the path to the index directory, the Analyzer to process all data being indexed, and a createFlag that is set to true, so that the index is opened in the append mode.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 58 | 톰캣에서 로그 파일 저장시 ansi 로 저장되는 현상 | 황제낙엽 | 2024.10.21 | 666 |
| 57 |
Jsoup 을 이용하여 웹 크롤링(Web Crawling)
| 황제낙엽 | 2023.08.09 | 496 |
| 56 | Apache Log4j™ 2 사용하기 | 황제낙엽 | 2023.04.28 | 594 |
| 55 | Migrating from Log4j 1.x to 2.x | 황제낙엽 | 2023.04.28 | 718 |
| 54 |
SLF4J 를 사용해야 하는 이유
| 황제낙엽 | 2022.09.17 | 585 |
| 53 | Apache Log4j 2 Configuration 파일 설정 | 황제낙엽 | 2020.04.01 | 818 |
| 52 |
이클립스에서 JUnit 사용하기
| 황제낙엽 | 2019.04.02 | 728 |
| 51 | 각 레벨별 출력파일 설정 예제 | 황제낙엽 | 2018.09.18 | 775 |
| 50 |
log4j-1.2.15.jar 와 log4j.properties 예제
| 황제낙엽 | 2017.08.04 | 840 |
| 49 |
POI HSSF, XSSF, SXSSF 성능 분석
| 황제낙엽 | 2013.11.05 | 2097 |
| 48 | POI-HSSF and POI-XSSF - Java API To Access Microsoft Excel Format Files | 황제낙엽 | 2013.11.05 | 1775 |
| 47 | Commons Logging과 Log4J | 황제낙엽 | 2013.03.07 | 733 |
| 46 |
Library & Properties 파일
| 황제낙엽 | 2011.12.23 | 982 |
| 45 |
Cell 의 wrap 설정 (텍스트 개행)
| 황제낙엽 | 2011.05.09 | 3610 |
| 44 |
XSSF Examples
| 황제낙엽 | 2011.05.04 | 817 |
| 43 | 병합된 셀의 스타일( border) 설정하기 | 황제낙엽 | 2011.05.03 | 2214 |
| 42 | 셀 크기 조정 (자동 크기 조정) | 황제낙엽 | 2011.05.03 | 8316 |
| 41 | 셀 병합 | 황제낙엽 | 2011.05.03 | 697 |
| 40 | WebSphere 에서 Log4j 사용하기 | 황제낙엽 | 2011.04.15 | 633 |
| 39 |
Map 사용 예제
| 황제낙엽 | 2010.10.17 | 622 |