Changeset 9874 for trunk/indexers


Ignore:
Timestamp:
2005-05-16T11:02:50+12:00 (19 years ago)
Author:
kjdon
Message:

merged from branch ant-install-branch: merge 1

Location:
trunk/indexers/mg
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/indexers/mg/java/org/greenstone/mg/MGQueryResult.java

    r3794 r9874  
    5353    }
    5454
     55    public boolean isClear() {
     56    return (total_num_docs_ == 0 && docs_.isEmpty() && terms_.isEmpty());
     57    }
    5558
    5659    /** returns the result as a String - useful for printing out results */
  • trunk/indexers/mg/jni/MGWrapperImpl.c

    r8920 r9874  
    315315
    316316  /* Check that the index was loaded successfully */
    317   assert(qd != NULL);
     317  if (qd==NULL) {
     318    return NULL;
     319  }
     320  /*assert(qd != NULL);*/
    318321
    319322  /* Get the document position and length in the text file */
     
    372375  jthrowable exc;
    373376
    374   /* Make sure an index has been specified */
    375   index_path = data->queryInfo->index;
    376   assert(index_path != NULL);
    377 
    378   /* Obtain C versions of the two string parameters */
    379   base_dir = (*j_env)->GetStringUTFChars(j_env, j_base_dir, NULL);
    380   if (base_dir == NULL) {
    381     return;
    382   }
    383   text_path = (*j_env)->GetStringUTFChars(j_env, j_text_path, NULL);
    384   if (text_path == NULL) {
    385     (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir);
    386     return;
    387   }
    388 
    389   /* Load the appropriate index for satisfying this request */
    390   qd = loadIndexData((char*) base_dir, (char*) index_path, (char*) text_path);
    391 
    392   /* The C text strings are no longer needed */
    393   (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir);
    394   (*j_env)->ReleaseStringUTFChars(j_env, j_text_path, text_path);
    395 
    396   /* Check that the index was loaded successfully */
    397   assert(qd != NULL);
    398 
    399   /* Remove anything hanging around from last time */
    400   FreeQueryDocs(qd);
    401 
     377  /* First of all, clear the previous result */
    402378  /* The result to write to */
    403379  result_ptr = (*j_env)->GetObjectField(j_env, j_obj, FID_query_result);
     
    411387    return;
    412388  }
     389
     390  /* Make sure an index has been specified */
     391  index_path = data->queryInfo->index;
     392  assert(index_path != NULL);
     393
     394  /* Obtain C versions of the two string parameters */
     395  base_dir = (*j_env)->GetStringUTFChars(j_env, j_base_dir, NULL);
     396  if (base_dir == NULL) {
     397    return;
     398  }
     399  text_path = (*j_env)->GetStringUTFChars(j_env, j_text_path, NULL);
     400  if (text_path == NULL) {
     401    (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir);
     402    return;
     403  }
     404
     405  /* Load the appropriate index for satisfying this request */
     406  qd = loadIndexData((char*) base_dir, (char*) index_path, (char*) text_path);
     407
     408  /* The C text strings are no longer needed */
     409  (*j_env)->ReleaseStringUTFChars(j_env, j_base_dir, base_dir);
     410  (*j_env)->ReleaseStringUTFChars(j_env, j_text_path, text_path);
     411
     412  /* Check that the index was loaded successfully */
     413  if (qd == NULL) {
     414    return;
     415  }
     416  /*assert(qd != NULL);*/
     417
     418  /* Remove anything hanging around from last time */
     419  FreeQueryDocs(qd);
    413420
    414421  /* Obtain a C version of the query string */
  • trunk/indexers/mg/src/images/WIN32.MAK

    r3921 r9874  
    156156
    157157mostlyclean:
    158     rm -f *$o _*.c _*.o *._c *._o core core.*
     158    if exist *$o del *$o
     159    if exist  _*.c del  _*.c
     160    if exist _*.o  del  _*.o
     161    if exist *._c  del *._c
     162    if exist *._o  del *._o
     163    if exist core  del  core
     164    if exist core.* del  core.*
    159165 
    160166clean: mostlyclean
    161     rm -f $(EXEC)
     167    if exist *$e del *$e
    162168 
    163169distclean: clean
    164     rm -f ansi2knr
    165     rm -f Makefile
    166  
     170    del ansi2knr
     171     
    167172maintainer-clean: distclean
    168173    @echo "This command is intended only for maintainers to use;"
  • trunk/indexers/mg/src/text/win32.mak

    r7585 r9874  
    237237clean:
    238238        if exist *$o del *$o
    239     if exist $(EXEC) del $(EXEC)
     239    if exist *$e del *$e
    240240        if exist libmgtextin.lib del libmgtextin.lib
    241241        if exist libmgpass.lib del libmgpass.lib
  • trunk/indexers/mg/winMake.bat

    r6416 r9874  
    2929    cd ..\..
    3030
     31    cd java\org\greenstone\mg
     32    call winMake.bat %1
     33    cd ..\..\..\..
     34
    3135    cd jni
    3236    %MAKE% %MAKE_OPTIONS% win32.mak %1
     
    4044
    4145:done
     46
     47
Note: See TracChangeset for help on using the changeset viewer.