[sword-devel] indexed search discrepancy (and sword 1.6.0+dfsg-2)

Jonathan Marsden jmarsden at fastmail.fm
Sat Aug 29 23:39:52 MST 2009


Matthew Talbert wrote:

> Yes, the idea was more to just show what changes might be needed and
> get some feedback. It wasn't intended to be a patch (or patches) to
> apply directly to trunk.

OK.  In case anyone has any use for it, my minimalist
larger-search-buffer patch, extracted from your larger patch, is below.
 Seems to work for me so far, including testing search Finney "good" .

Time for bed, so the stopwords patch will have to wait for another time.

Jonathan


Index: main/src/modules/swmodule.cpp
===================================================================
--- main.orig/src/modules/swmodule.cpp  2009-08-29 22:44:21 -0700
+++ main/src/modules/swmodule.cpp       2009-08-29 23:13:23 -0700
@@ -496,7 +496,7 @@
 #ifdef USELUCENE
        if (searchType == -4) { // lucene
                //Buffers for the wchar<->utf8 char* conversion
-               const unsigned short int MAX_CONV_SIZE = 2047;
+         const unsigned int MAX_CONV_SIZE = 1024 * 1024;
                wchar_t wcharBuffer[MAX_CONV_SIZE + 1];
                char utfBuffer[MAX_CONV_SIZE + 1];

@@ -980,6 +980,7 @@
        SWKey *searchKey = 0;
        SWKey textkey;
        SWBuf c;
+       const unsigned int MAX_CONV_SIZE = 1024 * 1024;


        // turn all filters to default values
@@ -1027,6 +1028,7 @@

        ramDir = new RAMDirectory();
        coreWriter = new IndexWriter(ramDir, an, true);
+       coreWriter->setMaxFieldLength(MAX_CONV_SIZE);



@@ -1056,7 +1058,6 @@
        SWBuf proxLem;
        SWBuf strong;

-       const short int MAX_CONV_SIZE = 2047;
        wchar_t wcharBuffer[MAX_CONV_SIZE + 1];

        char err = Error();





More information about the sword-devel mailing list