-
Notifications
You must be signed in to change notification settings - Fork 0
Swagger-Ranger/lia2e
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Lucene in Action (2nd Edition)的随书源码 运行源码: 0.源码是ant构建的,所以将项目下的build.xml引入即可 1.因为存在 lucene-core-2.4.0.jar 包和 lucene-core-3.0.2.jar 冲突;如果方法找不到,删除 lib/nutch 下对应的 lucene-core-2.4.0.jar 2.NutchExample 用的是 lucene-core-2.4.0.jar;所以如果用的是 lucene-core-3.0.2.jar包就注释掉代码,在用的时候把包换回来再打开 3.HighlightTest 和 HighlightIt 包冲突了,我直接注释掉了;没有去解决包冲突 4.Indexer 运行 需要传入两个参数,直接在代码中写入参数 ```java args = new String[2]; args[0] = "indexes/MeetLucene"; args[1] = "src/lia/meetlucene/data"; ``` Welcome to Lucene in Action (2nd Edition)! This source code distribution is a companion to the Lucene in Action book available from Manning Publications. To purchase an electronic or printed copy of the book, visit http://www.manning.com/hatcher3 R E Q U I R E M E N T S ----------------------- * JDK 1.6+ * Ant 1.7+ (to run the automated examples) * JUnit 3.8.1+ - junit.jar should be in ANT_HOME/lib I N S T A L L A T I O N ----------------------- You've already unpacked the distribution, since you're reading this file. You may now run most of the code using Ant. We recommend that you open the code in your favorite editor or IDE to follow how the examples work. R U N N I N G ------------- We recommend you run the examples using the provided Ant build file. However, you may run the examples without Ant with some unsupported and manual configuration. The JAR files in the lib directory need to be in your build and execution classpath to run manually. Several programs require external information such as command-line arguments and JVM system properties - all of which the Ant build file takes care of. Reference the build file and source for these configuration details. R U N N I N G W I T H A N T ---------------------------------- The code is primarily JUnit test cases, with some Java main() programs also. All the JUnit test cases and several of the main() programs are easily run using the Ant build.xml file provided. To run all the JUnit tests, run the "test" target: % ant test The first time the build is executed, the source code is compiled and a few Lucene indexes are built. As long as nothing changes, this is a one-time setup, and successive builds will bypass this effort. Several of the included Java main() programs may be launched individually. From output of "ant -p", these targets are, including descriptions: AnalyzerDemo Demonstrates analysis of text AnalyzerUtils Demonstrates analysis of static text BooksLikeThis Demonstrates a term vector use ChineseDemo Examples of Chinese analysis CreateSpellCheckerIndex Create spell checker index. DigesterXMLDocument Transforms custom XML file into a Document. Explainer Demonstrates Lucene's Explanation feature FastVectorHighlighterSample Demonstrates Lucene's fast-vector-highlighter HighlightIt Demonstrates Lucene's highlighter Indexer Indexes a directory of .txt files MetaphoneAnalyzer Demonstrates analysis of static text using MetaphoneAnalyzer NutchExample Demonstrates Nutch's analyzer OpenFileLimitCheck Tests how many open files your environment allows PrecisionRecall Measure precision and recall using contrib/benchmark SAXXMLDocument Transforms custom XML file into a Document. SearchServer Remote and multi-index searching Searcher Searches an index built by Indexer SortingExample Demonstrates several ways to sort results SpatialLucene Spatial search with Lucene SpellCheckerExample Tests respelling a word SynonymAnalyzerViewer Examples of synonym injection TikaIndexer Indexes a directory of .txt files VerboseIndexing Shows IndexWriter's infoStream output To run any of these examples, simply run "ant" followed by the desired target name. For example, run the CellPhone application using: % ant CellPhone The Ant targets provide information of what is about to execute. This information is followed by a prompt requiring you to press return to continue. Additionally, several examples require user input, with defaults shown in brackets. T I P S ------- * To run Ant with less decoration, use the -e switch. * To run a single test case: ant test -Dtest=<name of test without "Test" suffix> example: ant test -Dtest=QueryParser * To bypass the "Press return to continue..." prompts, add the -Dnopause=true command-line switch. * Run "ant clean" to force a rebuild of the code and test indexes. * Follow along with the examples using the source code and the book itself. The code was written for the book and makes much more sense in context with elaborate explanations. K N O W N I S S U E S ----------------------- * Performance tests may fail if your system is heavily loaded at the time or has insufficient RAM or processor/disk speed * SearchServer does not exit, so the Ant launcher forcefully times-out its execution. However, the example of running SearchClient succeeds successfully before this time-out. C O N T A C T I N F O R M A T I O N -------------------------------------- Manning provides an Author Online forum accessible from: http://www.manning.com/hatcher3 The authors host a companion website at: http://www.lucenebook.com For general Lucene information and support, please visit Lucene's website for pointers to FAQ's, articles, the user e-mail list, and the informative and ever evolving wiki. The main Lucene website is: http://lucene.apache.org
About
lucene in action(2edition) 代码
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published