Revision 32091 branches/v2_0_0_prep/libraries/libGeocoding/src-test/org/gvsig/geocoding/index/LuceneIndexDataStoreTest.java
LuceneIndexDataStoreTest.java | ||
---|---|---|
79 | 79 |
} |
80 | 80 |
|
81 | 81 |
public void testSnowballIndex() throws Exception { |
82 |
log.info("///////////// SNOWBALL TEST ...");
|
|
83 |
log.info("Load pattern ...");
|
|
82 |
log.debug("///////////// SNOWBALL TEST ...");
|
|
83 |
log.debug("Load pattern ...");
|
|
84 | 84 |
GeocodingPattern pat = getPattern(); |
85 | 85 |
|
86 |
log.info("Load data store ...");
|
|
86 |
log.debug("Load data store ...");
|
|
87 | 87 |
FeatureStore store = LayerServer.getSHPStore(LayerServer |
88 | 88 |
.getStreetsFile()); |
89 | 89 |
|
90 |
log.info("Create indexes ...");
|
|
90 |
log.debug("Create indexes ...");
|
|
91 | 91 |
File tmpFile = new File("/home/vsanjaime/tmp/index"); |
92 | 92 |
IndexWriter indexWriter = new IndexWriter(tmpFile.getAbsolutePath(), |
93 | 93 |
new SnowballAnalyzer("Spanish"), true); |
... | ... | |
125 | 125 |
} |
126 | 126 |
indexWriter.optimize(); |
127 | 127 |
|
128 |
log.info("Buscar ...");
|
|
128 |
log.debug("Buscar ...");
|
|
129 | 129 |
String path = tmpFile.getAbsolutePath(); |
130 | 130 |
IndexSearcher searcher = new IndexSearcher(path); |
131 | 131 |
|
... | ... | |
137 | 137 |
for (int i = 0; i < 20; i++) { |
138 | 138 |
Document docu = hits.doc(i); |
139 | 139 |
|
140 |
log.info(docu.get("GID") + "\t " + docu.get("STREET_NAM") +" - "+docu.get("PROV") + "("
|
|
140 |
log.debug(docu.get("GID") + "\t " + docu.get("STREET_NAM") +" - "+docu.get("PROV") + "("
|
|
141 | 141 |
+ hits.score(i) + ")"); |
142 | 142 |
} |
143 |
log.info("Resultados: " + hits.length());
|
|
144 |
log.info("FIN ....");
|
|
143 |
log.debug("Resultados: " + hits.length());
|
|
144 |
log.debug("FIN ....");
|
|
145 | 145 |
} |
146 | 146 |
|
147 | 147 |
// public void testStandardIndex() throws Exception { |
Also available in: Unified diff