]>
Commit | Line | Data |
---|---|---|
a8e5c9fc JR |
1 | diff -up sword-1.6.2/configure.clucene2 sword-1.6.2/configure |
2 | --- sword-1.6.2/configure.clucene2 2010-10-22 23:14:28.000000000 +0200 | |
3 | +++ sword-1.6.2/configure 2011-10-02 21:27:35.420704861 +0200 | |
4 | @@ -16348,9 +16348,9 @@ for flag in $with_clucene; do | |
5 | if test -z "$clucene_set_failed"; then | |
6 | if test -e "$flag/include/CLucene.h"; then | |
7 | # 64-bit checks first | |
8 | - if test -e "$flag/lib64/libclucene.la" || test -e "$flag/lib64/libclucene.so"; then | |
9 | + if test -e "$flag/lib64/libclucene-core.la" || test -e "$flag/lib64/libclucene-core.so"; then | |
10 | clucene_set_failed=$flag | |
11 | - CLUCENE_LIBS="-L$flag/lib64 -lclucene" | |
12 | + CLUCENE_LIBS="-L$flag/lib64 -lclucene-core" | |
13 | if test -e "$flag/include/CLucene/clucene-config.h"; then | |
14 | CLUCENE_CXXFLAGS="-I$flag/include" | |
15 | else | |
16 | @@ -16358,9 +16358,9 @@ for flag in $with_clucene; do | |
17 | fi | |
18 | else | |
19 | # 32-bit checks | |
20 | - if test -e "$flag/lib/libclucene.la" || test -e "$flag/lib/libclucene.so"; then | |
21 | + if test -e "$flag/lib/libclucene-core.la" || test -e "$flag/lib/libclucene-core.so"; then | |
22 | clucene_set_failed=$flag | |
23 | - CLUCENE_LIBS="-L$flag/lib -lclucene" | |
24 | + CLUCENE_LIBS="-L$flag/lib -lclucene-core" | |
25 | if test -e "$flag/include/CLucene/clucene-config.h"; then | |
26 | CLUCENE_CXXFLAGS="-I$flag/include" | |
27 | else | |
28 | diff -up sword-1.6.2/m4/acx_clucene.m4.clucene2 sword-1.6.2/m4/acx_clucene.m4 | |
29 | --- sword-1.6.2/m4/acx_clucene.m4.clucene2 2007-05-19 23:28:23.000000000 +0200 | |
30 | +++ sword-1.6.2/m4/acx_clucene.m4 2011-10-02 21:27:35.420704861 +0200 | |
31 | @@ -29,9 +29,9 @@ for flag in $with_clucene; do | |
32 | if test -z "$clucene_set_failed"; then | |
33 | if test -e "$flag/include/CLucene.h"; then | |
34 | # 64-bit checks first | |
35 | - if test -e "$flag/lib64/libclucene.la" || test -e "$flag/lib64/libclucene.so"; then | |
36 | + if test -e "$flag/lib64/libclucene-core.la" || test -e "$flag/lib64/libclucene-core.so"; then | |
37 | clucene_set_failed=$flag | |
38 | - CLUCENE_LIBS="-L$flag/lib64 -lclucene" | |
39 | + CLUCENE_LIBS="-L$flag/lib64 -lclucene-core" | |
40 | if test -e "$flag/include/CLucene/clucene-config.h"; then | |
41 | CLUCENE_CXXFLAGS="-I$flag/include" | |
42 | else | |
43 | @@ -39,9 +39,9 @@ for flag in $with_clucene; do | |
44 | fi | |
45 | else | |
46 | # 32-bit checks | |
47 | - if test -e "$flag/lib/libclucene.la" || test -e "$flag/lib/libclucene.so"; then | |
48 | + if test -e "$flag/lib/libclucene-core.la" || test -e "$flag/lib/libclucene-core.so"; then | |
49 | clucene_set_failed=$flag | |
50 | - CLUCENE_LIBS="-L$flag/lib -lclucene" | |
51 | + CLUCENE_LIBS="-L$flag/lib -lclucene-core" | |
52 | if test -e "$flag/include/CLucene/clucene-config.h"; then | |
53 | CLUCENE_CXXFLAGS="-I$flag/include" | |
54 | else | |
55 | diff -up sword-1.6.2/src/modules/swmodule.cpp.clucene2 sword-1.6.2/src/modules/swmodule.cpp | |
56 | --- sword-1.6.2/src/modules/swmodule.cpp.clucene2 2011-10-02 21:32:40.825795281 +0200 | |
57 | +++ sword-1.6.2/src/modules/swmodule.cpp 2011-10-02 22:02:42.441506634 +0200 | |
58 | @@ -40,7 +40,7 @@ | |
59 | ||
60 | #ifdef USELUCENE | |
61 | #include <CLucene.h> | |
62 | -#include <CLucene/CLBackwards.h> | |
63 | +//#include <CLucene/CLBackwards.h> | |
64 | ||
65 | //Lucence includes | |
66 | //#include "CLucene.h" | |
67 | @@ -59,6 +59,9 @@ using namespace lucene::search; | |
68 | ||
69 | using std::vector; | |
70 | ||
71 | +extern size_t lucene_utf8towcs(wchar_t *, const char *, size_t maxslen); | |
72 | +extern size_t lucene_wcstoutf8 (char *, const wchar_t *, size_t maxslen); | |
73 | + | |
74 | SWORD_NAMESPACE_START | |
75 | ||
76 | SWDisplay SWModule::rawdisp; | |
77 | @@ -1144,7 +1147,7 @@ signed char SWModule::createSearchFramew | |
78 | ||
79 | lucene_utf8towcs(wcharBuffer, keyText, MAX_CONV_SIZE); //keyText must be utf8 | |
80 | // doc->add( *(new Field("key", wcharBuffer, Field::STORE_YES | Field::INDEX_TOKENIZED))); | |
81 | - doc->add( *Field::Text(_T("key"), wcharBuffer ) ); | |
82 | + doc->add(*_CLNEW Field(_T("key"), wcharBuffer, Field::STORE_YES | Field::INDEX_TOKENIZED) ); | |
83 | ||
84 | ||
85 | if (includeKeyInSearch) { | |
86 | @@ -1155,11 +1158,11 @@ signed char SWModule::createSearchFramew | |
87 | } | |
88 | ||
89 | lucene_utf8towcs(wcharBuffer, content, MAX_CONV_SIZE); //content must be utf8 | |
90 | - doc->add( *Field::UnStored(_T("content"), wcharBuffer) ); | |
91 | + doc->add(*_CLNEW Field(_T("content"), wcharBuffer, Field::STORE_NO | Field::INDEX_TOKENIZED)); | |
92 | ||
93 | if (strong.length() > 0) { | |
94 | lucene_utf8towcs(wcharBuffer, strong, MAX_CONV_SIZE); | |
95 | - doc->add( *Field::UnStored(_T("lemma"), wcharBuffer) ); | |
96 | + doc->add(*_CLNEW Field(_T("lemma"), wcharBuffer, Field::STORE_NO | Field::INDEX_TOKENIZED) ); | |
97 | //printf("setting fields (%s).\ncontent: %s\nlemma: %s\n", (const char *)*key, content, strong.c_str()); | |
98 | } | |
99 | ||
100 | @@ -1280,12 +1283,12 @@ signed char SWModule::createSearchFramew | |
101 | ||
102 | //printf("proxBuf after (%s).\nprox: %s\nproxLem: %s\n", (const char *)*key, proxBuf.c_str(), proxLem.c_str()); | |
103 | ||
104 | - doc->add( *Field::UnStored(_T("prox"), wcharBuffer) ); | |
105 | + doc->add(*_CLNEW Field(_T("prox"), wcharBuffer, Field::STORE_NO | Field::INDEX_TOKENIZED) ); | |
106 | good = true; | |
107 | } | |
108 | if (proxLem.length() > 0) { | |
109 | lucene_utf8towcs(wcharBuffer, proxLem, MAX_CONV_SIZE); //keyText must be utf8 | |
110 | - doc->add( *Field::UnStored(_T("proxlem"), wcharBuffer) ); | |
111 | + doc->add(*_CLNEW Field(_T("proxlem"), wcharBuffer, Field::STORE_NO | Field::INDEX_TOKENIZED) ); | |
112 | good = true; | |
113 | } | |
114 | if (good) { | |
115 | @@ -1315,7 +1318,9 @@ signed char SWModule::createSearchFramew | |
116 | fsWriter = new IndexWriter(d, an, true); | |
117 | } | |
118 | ||
119 | - Directory *dirs[] = { ramDir, 0 }; | |
120 | + ValueArray<Directory*> dirs(2); | |
121 | + dirs[0] = ramDir; | |
122 | + dirs[1] = 0; | |
123 | fsWriter->addIndexes(dirs); | |
124 | fsWriter->close(); | |
125 |