version 1.0.0 does not support 'not_analyzed' #199

Closed
runetvilum opened this Issue Jul 18, 2014 · 6 comments

Comments

Projects
None yet
2 participants

In version 0.9.0 my index function was working perfectly with 'not_analyzed' for fields that should be sortable.
In version 1.0.0 the 'not_analyzed' options does not work. The fields are always analyzed.
Her is my index function that is working in 0.9.0:
function (doc) {
if (doc.type && doc.type == 'data') {
var ret = new Document();

    function idx(obj) {
        for (var key in obj) {
            switch (typeof obj[key]) {
            case 'object':
                idx(obj[key]);
                break;
            case 'function':
                break;
            default:
                if (key === 'titel') {
                    ret.add(obj[key], {
                        "field": "titel",
                        "store": "yes",
                        "index": "not_analyzed"
                    });
                    ret.add(obj[key].toLowerCase(), {
                        "field": "sort",
                        "index": "not_analyzed"
                    });
                }
                ret.add('all', {
                    "field": "all"
                });
                ret.add(obj[key]);
                break;
            }
        }
    }
    idx(doc.properties);
    return ret;
} else return null;

}

Owner

rnewson commented Jul 18, 2014

hm, it should. Thanks for the report, I'll look into it right now.

Owner

rnewson commented Jul 18, 2014

really odd, it seems Rhino is not receiving the second argument to "add" most of the time.

Owner

rnewson commented Jul 18, 2014

nope, I see it. It's the switch to the new Lucene 4.0 field types. "TextField" is very prescriptive, I didn't factor that in at all. Fixing now.

rnewson closed this in 0b314fb Jul 18, 2014

Owner

rnewson commented Jul 18, 2014

@runetvilum If you could confirm this is the fix for your case I will roll out 1.0.1. Thanks so much for your report, red faced here.

Perfect, this solves my problem.

Owner

rnewson commented Jul 19, 2014

1.0.1 is released, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment