Changeset 16349
- Timestamp:
- 2008-07-11T10:03:44+12:00 (15 years ago)
- Location:
- indexers/trunk/mgpp
- Files:
-
- 1 added
- 3 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
indexers/trunk/mgpp/java/org/greenstone/mgpp/MGPPRetrieveWrapper.java
r14487 r16349 1 1 /* 2 2 * MGPPRetrieveWrapper.java 3 * Copyright (C) 200 2New Zealand Digital Library, http://www.nzdl.org3 * Copyright (C) 2007 New Zealand Digital Library, http://www.nzdl.org 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify … … 19 19 package org.greenstone.mgpp; 20 20 21 import java.util.Vector;22 21 23 /** java wrapper class for access to mgpp in C++ 22 23 /** java wrapper class for access to mgpp document retrieval mgpp in C++ 24 24 * 25 * the native side implemented in MGPPWrapperImpl.cpp 26 * uses MGPPQueryResult to hold the result of a query. the 27 * result of a getDocument is a String 28 * uses the jni 25 * the native side is implemented in MGPPSearchWrapperImpl.cpp 26 * the result of getDocument is a String 27 * uses jni 29 28 * 30 *@see MGPPQueryResult31 29 */ 32 30 public class MGPPRetrieveWrapper { 33 31 34 /** the query result35 * will be filled in by runQuery36 */37 protected MGPPQueryResult mgpp_query_result_=null;38 /** pointer to c++ MGPPWrapperData class - cached indexData and queryInfo39 */40 protected long mgpp_data_ptr_=0;41 42 32 static { 43 33 System.loadLibrary("mgppretrievejni"); 44 initIDs();45 34 } 46 35 47 36 public MGPPRetrieveWrapper() { 48 mgpp_query_result_ = new MGPPQueryResult();49 initCppSide();50 37 } 51 52 /** initialises field and method IDs for java side to enable access on53 C++ side */54 //these two init methods and the load and unload methods are shared by search and retrieve55 private static native void initIDs();56 57 /** initialises the mgpp_data_ptr_ */58 private native boolean initCppSide();59 38 60 39 /** returns a document: number docnum at level level … … 67 46 long docnum ); 68 47 69 /** the public method - converts between utf-8 and unicode70 */71 // public String getDocument(String text_path,72 // String level,73 // long docnum ) {74 75 //String utf8_doc = getUtF8Document(base_dir, text_path, level, docnum);76 77 /** load up the data structure for index78 * - maintains state between requests as can be slow79 * index_path should provide80 * the absolute location of the mgpp index files eg ..../index/tt/demo81 */82 public native boolean loadIndexData(String index_path);83 /** unloads the data */84 public native boolean unloadIndexData();85 86 // query param methods87 //88 // /** if on=true, sets default stemming on - its off by default*/89 // public native void setStem(boolean on);90 //91 // /** if on=true, sets default accentfolding on - its off by default*/92 // public native void setAccentFold(boolean on);93 //94 // /** if on=true, sets default casefolding on - its off by default */95 // public native void setCase(boolean on);96 // /** default is 50 */97 // public native void setMaxDocs(int num);98 // /** if on=true, sorts by rank, otherwise returns in build order -99 // default is on */100 // public native void setSortByRank(boolean on);101 // /** if on=true, a query returns term freq info - default is on */102 // public native void setReturnTerms(boolean on);103 // /** sets the granularity of the query - default 'Document' */104 // public native void setQueryLevel(String level);105 // /** sets the granularity of the result - default 'Document' */106 // public native void setReturnLevel(String level);107 // /** sets the default boolean operator - AND(=1)/OR(=0) */108 // public native void setMatchMode(int mode);109 //110 // /** sets maxnumeric */111 // public native void setMaxNumeric(int maxnumeric);112 // /** returns a string with all the current query param settings */113 // public native String getQueryParams();114 //115 // /** actually carry out the query. Use the set methods to set any query116 // params117 // * writes the result to query_result118 // */119 // public native void runQuery(String query_string);120 //121 // /** get the result out of the wrapper */122 // public MGPPQueryResult getQueryResult() {123 // return mgpp_query_result_;124 // }125 //126 48 } -
indexers/trunk/mgpp/java/org/greenstone/mgpp/Makefile.in
r15559 r16349 48 48 compile: setup 49 49 $(JAVAC) -d $(JAVACLASSDIR) -sourcepath $(JAVASRCDIR) $(JAVACOPTIONS) *.java 50 $(JAVAH) -classpath $(JAVACLASSPATH) -d $(MGPPHOME)/jni org.greenstone.mgpp.MGPPWrapper50 # $(JAVAH) -classpath $(JAVACLASSPATH) -d $(MGPPHOME)/jni org.greenstone.mgpp.MGPPWrapper 51 51 $(JAVAH) -classpath $(JAVACLASSPATH) -d $(MGPPHOME)/jni org.greenstone.mgpp.MGPPPassesWrapper 52 52 $(JAVAH) -classpath $(JAVACLASSPATH) -d $(MGPPHOME)/jni org.greenstone.mgpp.MGPPSearchWrapper 53 $(JAVAH) -classpath $(JAVACLASSPATH) -d $(MGPPHOME)/jni org.greenstone.mgpp.MGPPRetrieveWrapper 53 54 $(JAR) cf $(MGPPHOME)/mgpp.jar -C $(JAVACLASSDIR) org 54 55 55 56 clean: 56 rm -rf $(JAVACLASSDIR) $(MGPPHOME)/mgpp.jar $(MGPPHOME)/jni/org_greenstone_mgpp_MGPP Wrapper.h $(MGPPHOME)/jni/org_greenstone_mgpp_MGPPPassesWrapper.h57 rm -rf $(JAVACLASSDIR) $(MGPPHOME)/mgpp.jar $(MGPPHOME)/jni/org_greenstone_mgpp_MGPPSearchWrapper.h $(MGPPHOME)/jni/org_greenstone_mgpp_MGPPRetrieveWrapper.h $(MGPPHOME)/jni/org_greenstone_mgpp_MGPPPassesWrapper.h 57 58 58 59 install: -
indexers/trunk/mgpp/java/org/greenstone/mgpp/Queryer.java
r16348 r16349 6 6 import java.io.File; 7 7 /** Queryer - java port of c++ Queryer 8 * - uses MGPP Wrapper to access mgpp8 * - uses MGPPSearchWrapper and MGPPRetrieveWrapper to access mgpp 9 9 * only has get document and search - full text browse not implemented 10 10 * 11 11 * run as: 12 12 * java org.greenstone.mgpp.Queryer <basedir> <indexdir> <textdir> 13 *@see MGPPWrapper 13 *@see MGPPSearchWrapper 14 *@see MGPPRetrieveWrapper 14 15 */ 15 16 public class Queryer { … … 52 53 index_path = base_dir + File.separatorChar+ index_path; 53 54 54 // the jni class to access mgpp stuff 55 MGPPWrapper wrapper = new MGPPWrapper(); 56 wrapper.loadIndexData(index_path); 57 55 // the jni classes to access mgpp stuff 56 MGPPSearchWrapper searcher = new MGPPSearchWrapper(); 57 MGPPRetrieveWrapper retriever = new MGPPRetrieveWrapper(); 58 searcher.loadIndexData(index_path); 59 58 60 // the return level 59 61 String level = "Section"; … … 83 85 switch (x) { 84 86 case 'q': // clean up and exit 85 wrapper.unloadIndexData();87 searcher.unloadIndexData(); 86 88 return; 87 89 case 'h': // print help message … … 89 91 break; 90 92 case 'd': // print query param settings 91 String info = wrapper.getQueryParams();93 String info = searcher.getQueryParams(); 92 94 System.out.println(info); 93 95 break; 94 96 case 'p': // print doc 95 97 int docnum = Integer.parseInt(data); 96 String doc = wrapper.getDocument(text_path,98 String doc = retriever.getDocument(text_path, 97 99 level, docnum); 98 100 System.out.println(doc); … … 100 102 case 'm': //match docs 101 103 int match = Integer.parseInt(data); 102 wrapper.setMaxDocs(match);104 searcher.setMaxDocs(match); 103 105 break; 104 106 case 's': // set stem on/off 105 107 int stem = Integer.parseInt(data); 106 108 if (stem==0 ){ 107 wrapper.setStem(false);109 searcher.setStem(false); 108 110 } else if(stem==1) { 109 wrapper.setStem(true);111 searcher.setStem(true); 110 112 } else { 111 113 System.err.println("Error: stem should be 0 or 1"); … … 115 117 int casef = Integer.parseInt(data); 116 118 if (casef==0) { 117 wrapper.setCase(false);119 searcher.setCase(false); 118 120 } else if (casef==1) { 119 wrapper.setCase(true);121 searcher.setCase(true); 120 122 } else { 121 123 System.err.println("Error: case should be 0 or 1"); … … 123 125 break; 124 126 case 'i': // set search level 125 wrapper.setQueryLevel(data);127 searcher.setQueryLevel(data); 126 128 break; 127 129 case 'l': // set result level 128 wrapper.setReturnLevel(data);130 searcher.setReturnLevel(data); 129 131 level = data; 130 132 break; … … 132 134 int rank = Integer.parseInt(data); 133 135 if (rank==0) { 134 wrapper.setSortByRank(false);136 searcher.setSortByRank(false); 135 137 } else if (rank==1) { 136 wrapper.setSortByRank(true);138 searcher.setSortByRank(true); 137 139 } else { 138 140 System.err.println("Error: rank should be 0 or 1"); … … 142 144 int type = Integer.parseInt(data); 143 145 if (type==0 || type==1) { 144 wrapper.setMatchMode(type);146 searcher.setMatchMode(type); 145 147 } else { 146 148 System.err.println("Error: type should be 0 (some) or 1 (all)"); … … 161 163 else { 162 164 // a query 163 wrapper.runQuery(command);164 MGPPQueryResult res = wrapper.getQueryResult();165 searcher.runQuery(command); 166 MGPPQueryResult res = searcher.getQueryResult(); 165 167 if (res.hasSyntaxError()) { 166 168 System.out.println("invalid syntax error\n"); -
indexers/trunk/mgpp/jni/MGPPRetrieveWrapperImpl.cpp
r14910 r16349 1 1 /* 2 2 * MGPPRetrieveWrapperImpl.c 3 * Copyright (C) 200 2New Zealand Digital Library, http://www.nzdl.org3 * Copyright (C) 2007 New Zealand Digital Library, http://www.nzdl.org 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify … … 17 17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 18 */ 19 19 20 #ifdef __WIN32__ 20 21 #include <win32cfg.h> 21 #include <strstream>22 #include <sstream>23 #else24 #ifdef __APPLE__25 #include <strstream>26 #include <sstream>27 #else28 #include <sstream>29 #endif30 22 #endif 31 23 32 24 #include <jni.h> 33 25 #include "org_greenstone_mgpp_MGPPRetrieveWrapper.h" 34 #include "MGPPWrapperImpl.h"35 26 #include "TextGet.h" 36 #include "GSDLQueryParser.h"37 #include "MGQuery.h"38 39 MGPPWrapperData::MGPPWrapperData() {40 indexData = new IndexData();41 queryInfo = new QueryInfo();42 27 43 if (queryInfo==NULL) {44 cerr<<"couldn't allocate new query info\n";45 if (indexData!=NULL) {46 delete indexData;47 }48 }49 50 // set all the default params51 //SetCStr(queryInfo->docLevel, "Document"); // the level to search at52 queryInfo->maxDocs = 50;53 queryInfo->sortByRank = true;54 queryInfo->exactWeights = false;55 queryInfo->needRankInfo = true;56 queryInfo->needTermFreqs = true;57 58 UCArrayClear(level);59 SetCStr(level, "Document"); // the level to return docs at60 defaultStemMethod=0;61 defaultBoolCombine=0;62 maxNumeric = 4;63 }64 65 MGPPWrapperData::~MGPPWrapperData() {66 if (indexData !=NULL) {67 delete indexData;68 }69 if (queryInfo !=NULL) {70 delete queryInfo;71 }72 }73 74 // ********************************************75 // initialisation stuff76 // ********************************************77 78 // cached ids for java stuff79 jfieldID FID_mgpp_data = NULL; // MGPPWrapperData80 jfieldID FID_query_result = NULL; // MGPPQueryResult81 jmethodID MID_addDoc=NULL; // MGPPQueryResult.addDoc()82 jmethodID MID_addTerm=NULL; // MGPPQueryResult.addTerm()83 jmethodID MID_setTotalDocs=NULL; // MGPPQueryResult.setTotalDocs()84 jmethodID MID_clearResult=NULL; //MGPPQueryResult.clear()85 jmethodID MID_setSyntaxError=NULL; // MGPPQueryResult.setSyntaxError()86 jclass CID_String=NULL; // class ID of String87 88 /* to access objects and methods on java side, need their field/method ids -89 this initialises them at the start to avoid recalculating them each time they90 are needed91 Note: the descriptors need to be exactly right, otherwise you get an error92 saying "no such field" but no reference to the fact that it has the right93 name but the wrong type.94 Note: apparently the jclass is a local ref and should only work95 in the method that created it. It seems to work ok, but I'll make it96 global cos the book said I should, and it may avoid future hassles.97 */98 JNIEXPORT void JNICALL99 Java_org_greenstone_mgpp_MGPPRetrieveWrapper_initIDs (JNIEnv *j_env, jclass j_cls) {100 101 FID_mgpp_data = j_env->GetFieldID(j_cls, "mgpp_data_ptr_", "J"); //a long-"J"102 if (FID_mgpp_data==NULL) {103 cerr <<"MGPP JNI: field mgpp_data_ptr_ not found"<<endl;104 }105 106 FID_query_result = j_env->GetFieldID(j_cls, "mgpp_query_result_", "Lorg/greenstone/mgpp/MGPPQueryResult;"); // an object -"L<class name>;"107 if (FID_query_result==NULL) {108 cerr <<"MGPP JNI: field mgpp_query_result_ not found"<<endl;109 }110 // the methods we want to use111 112 // addDoc(long doc, float rank)113 jclass JC_MGPPQueryResult = j_env->FindClass("org/greenstone/mgpp/MGPPQueryResult");114 MID_addDoc = j_env->GetMethodID(JC_MGPPQueryResult, "addDoc", "(JF)V");115 if (MID_addDoc==NULL) {116 cerr <<"MGPP JNI: addDoc method not found"<<endl;117 }118 // addTerm(String term, String tag, int stem_method, long match_docs,119 // long term_freq, String[] equiv_terms)120 MID_addTerm = j_env->GetMethodID(JC_MGPPQueryResult, "addTerm", "(Ljava/lang/String;Ljava/lang/String;IJJ[Ljava/lang/String;)V");121 if (MID_addTerm==NULL) {122 cerr <<"MGPP JNI: method addTerm not found"<<endl;123 }124 125 // setTotalDocs(long)126 MID_setTotalDocs = j_env->GetMethodID(JC_MGPPQueryResult, "setTotalDocs", "(J)V");127 if (MID_setTotalDocs==NULL) {128 cerr <<"MGPP JNI: method setTotalDocs not found"<<endl;129 }130 131 MID_clearResult = j_env->GetMethodID(JC_MGPPQueryResult, "clear", "()V");132 if (MID_clearResult==NULL) {133 cerr <<"MGPP JNI: method clear not found"<<endl;134 }135 MID_setSyntaxError = j_env->GetMethodID(JC_MGPPQueryResult, "setSyntaxError", "(Z)V");136 if (MID_clearResult==NULL) {137 cerr <<"MGPP JNI: method setSyntaxError not found"<<endl;138 }139 140 // get the class for String to use in NewObjectArray in runQuery()141 // FindClass returns a local reference - have to convert it to a global one142 jclass local_CID_String = j_env->FindClass("java/lang/String");143 if (local_CID_String==NULL) {144 cerr <<"MGPP JNI: java String class not found"<<endl;145 } else {146 /* create a global ref */147 CID_String = (jclass)j_env->NewGlobalRef(local_CID_String);148 /* The local reference is no longer useful */149 j_env->DeleteLocalRef(local_CID_String);150 151 /* Is the global reference created successfully? */152 if (CID_String == NULL) {153 return; /* out of memory exception thrown */154 }155 }156 157 }158 159 /* the java side MGPPWrapper has a pointer to a C++ object - MGPPWrapperData160 initialise this and set the pointer161 */162 JNIEXPORT jboolean JNICALL163 Java_org_greenstone_mgpp_MGPPRetrieveWrapper_initCppSide (JNIEnv *j_env, jobject j_obj){164 165 MGPPWrapperData * data = new MGPPWrapperData();166 j_env->SetIntField(j_obj, FID_mgpp_data, (long)data);167 168 return true;169 170 }171 28 172 29 //**************************************************** … … 216 73 td.UnloadData(); 217 74 218 char * doc = GetCStr(docText); // do I need to free this char *??75 char * doc = GetCStr(docText); 219 76 jstring result = j_env->NewStringUTF(doc); 220 77 // release any gets … … 228 85 229 86 } 230 231 //******************************************232 // do a query233 // ****************************************234 235 /* load the IndexData - cached for querying236 */237 JNIEXPORT jboolean JNICALL238 Java_org_greenstone_mgpp_MGPPRetrieveWrapper_loadIndexData (JNIEnv *j_env, jobject j_obj, jstring j_index_name) {239 240 jint data_ptr = j_env->GetIntField(j_obj, FID_mgpp_data);241 MGPPWrapperData * data = (MGPPWrapperData *)data_ptr;242 243 #ifdef __WIN32__244 const char* base_dir = "";245 #else246 const char* base_dir = "/";247 #endif248 249 const char * index_name = j_env->GetStringUTFChars( j_index_name, NULL);250 if (index_name==NULL) {251 return false;252 }253 254 jboolean j_result=false;255 256 // why doesn't this complain about const??257 if (data->indexData->LoadData(base_dir, index_name)) {258 j_result=true;259 }260 261 // release any gets262 j_env->ReleaseStringUTFChars(j_index_name, index_name);263 264 return j_result;265 }266 267 /* unload the data268 */269 JNIEXPORT jboolean JNICALL270 Java_org_greenstone_mgpp_MGPPRetrieveWrapper_unloadIndexData (JNIEnv *j_env, jobject j_obj) {271 272 jint data_ptr = j_env->GetIntField(j_obj, FID_mgpp_data);273 MGPPWrapperData * data = (MGPPWrapperData *)data_ptr;274 275 data->indexData->UnloadData();276 return true;277 278 } -
indexers/trunk/mgpp/jni/MGPPSearchWrapperImpl.cpp
r14910 r16349 1 1 /* 2 * MGPPSearchWrapperImpl.c 3 * Copyright (C) 200 2New Zealand Digital Library, http://www.nzdl.org2 * MGPPSearchWrapperImpl.cpp 3 * Copyright (C) 2007 New Zealand Digital Library, http://www.nzdl.org 4 4 * 5 5 * This program is free software; you can redistribute it and/or modify … … 32 32 #include <jni.h> 33 33 #include "org_greenstone_mgpp_MGPPSearchWrapper.h" 34 #include "MGPPWrapperImpl.h" 35 #include "TextGet.h" 34 #include "MGPPSearchWrapperImpl.h" 36 35 #include "GSDLQueryParser.h" 37 36 #include "MGQuery.h" 38 37 39 MGPP WrapperData::MGPPWrapperData() {38 MGPPSearchData::MGPPSearchData() { 40 39 indexData = new IndexData(); 41 40 queryInfo = new QueryInfo(); … … 63 62 } 64 63 65 MGPP WrapperData::~MGPPWrapperData() {64 MGPPSearchData::~MGPPSearchData() { 66 65 if (indexData !=NULL) { 67 66 delete indexData; … … 77 76 78 77 // cached ids for java stuff 79 jfieldID FID_mgpp_data = NULL; // MGPP WrapperData78 jfieldID FID_mgpp_data = NULL; // MGPPSearchData 80 79 jfieldID FID_query_result = NULL; // MGPPQueryResult 81 80 jmethodID MID_addDoc=NULL; // MGPPQueryResult.addDoc() … … 157 156 } 158 157 159 /* the java side MGPP Wrapper has a pointer to a C++ object - MGPPWrapperData158 /* the java side MGPPSearchWrapper has a pointer to a C++ object - MGPPSearchData 160 159 initialise this and set the pointer 161 160 */ … … 163 162 Java_org_greenstone_mgpp_MGPPSearchWrapper_initCppSide (JNIEnv *j_env, jobject j_obj){ 164 163 165 MGPP WrapperData * data = new MGPPWrapperData();164 MGPPSearchData * data = new MGPPSearchData(); 166 165 j_env->SetIntField(j_obj, FID_mgpp_data, (long)data); 167 166 … … 180 179 181 180 jint data_ptr = j_env->GetIntField(j_obj, FID_mgpp_data); 182 MGPP WrapperData * data = (MGPPWrapperData *)data_ptr;181 MGPPSearchData * data = (MGPPSearchData *)data_ptr; 183 182 184 183 #ifdef __WIN32__ … … 212 211 213 212 jint data_ptr = j_env->GetIntField(j_obj, FID_mgpp_data); 214 MGPP WrapperData * data = (MGPPWrapperData *)data_ptr;213 MGPPSearchData * data = (MGPPSearchData *)data_ptr; 215 214 216 215 data->indexData->UnloadData(); … … 235 234 236 235 // the query data 237 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);236 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 238 237 239 238 // the result to write to … … 246 245 // clear the result 247 246 j_env->CallVoidMethod(result_ptr, MID_clearResult); 248 exc = j_env->ExceptionOccurred(); // this catches t ehexception I think - it247 exc = j_env->ExceptionOccurred(); // this catches the exception I think - it 249 248 //wont be thrown any further 250 249 if (exc) { … … 262 261 // invalid syntax 263 262 j_env->CallVoidMethod(result_ptr, MID_setSyntaxError, true); 264 cerr << "MGPP WrapperImpl: invalid query syntax!!\n";263 cerr << "MGPPSearchWrapperImpl: invalid query syntax!!\n"; 265 264 return; 266 265 } … … 336 335 jobject j_obj, 337 336 jboolean j_on) { 338 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);337 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 339 338 if (j_on) { 340 339 data->defaultStemMethod |= 2; … … 349 348 jobject j_obj, 350 349 jboolean j_on) { 351 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);350 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 352 351 if (j_on) { 353 352 data->defaultStemMethod |= 4; … … 362 361 jobject j_obj, 363 362 jboolean j_on) { 364 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);363 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 365 364 366 365 if (j_on) { … … 375 374 jobject j_obj, 376 375 jint j_max) { 377 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);376 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 378 377 data->queryInfo->maxDocs=j_max; 379 378 } … … 383 382 jobject j_obj, 384 383 jint j_max) { 385 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);384 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 386 385 data->maxNumeric=j_max; 387 386 } … … 391 390 jobject j_obj, 392 391 jboolean j_on) { 393 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);392 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 394 393 395 394 data->queryInfo->sortByRank=j_on; … … 400 399 jobject j_obj, 401 400 jboolean j_on) { 402 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);401 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 403 402 data->queryInfo->needTermFreqs = j_on; 404 403 … … 410 409 jstring j_level){ 411 410 412 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);411 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 413 412 414 413 const char * level = j_env->GetStringUTFChars(j_level, NULL); … … 430 429 jstring j_level){ 431 430 432 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);431 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 433 432 434 433 const char * level = j_env->GetStringUTFChars(j_level, NULL); … … 451 450 jint j_mode){ 452 451 453 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);452 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 454 453 data->defaultBoolCombine=j_mode; 455 454 … … 460 459 jobject j_obj){ 461 460 462 MGPP WrapperData * data = (MGPPWrapperData *)j_env->GetIntField(j_obj, FID_mgpp_data);461 MGPPSearchData * data = (MGPPSearchData *)j_env->GetIntField(j_obj, FID_mgpp_data); 463 462 464 463 // print the data to a stringstream, then convert to char*, then to
Note:
See TracChangeset
for help on using the changeset viewer.