Hello,

I’m trying to change a field’s query analysers. The following works but it 
replaces both index and query type analysers:

{
    "replace-field-type": {
        "name": "string_ci",
        "class": "solr.TextField",
        "sortMissingLast": true,
        "omitNorms": true,
        "stored": true,
        "docValues": false,
        "analyzer": {
            "type": "query",
            "tokenizer": {
                "class": "solr.StandardTokenizerFactory"
            },
            "filters": [
                {
                    "class": "solr.LowerCaseFilterFactory"
                }
            ]
        }
    }
}

I tried to change analyzer field to analyzers, to specify different analysers 
for query and index, but it gave error:

{
    "replace-field-type": {
        "name": "string_ci",
        "class": "solr.TextField",
        "sortMissingLast": true,
        "omitNorms": true,
        "stored": true,
        "docValues": false,
        "analyzers": [{
            "type": "query",
            "tokenizer": {
                "class": "solr.StandardTokenizerFactory"
            },
            "filters": [
                {
                    "class": "solr.LowerCaseFilterFactory"
                }
            ]
        },{
            "type": "index",
            "tokenizer": {
                "class": "solr.KeywordTokenizerFactory"
            },
            "filters": [
                {
                    "class": "solr.LowerCaseFilterFactory"
                }
            ]
        }]
    }
}

"errorMessages":["Plugin init failure for [schema.xml]....
"msg":"error processing commands",...

How can I specify different analyzers for query and index type when using 
schema api?

Sent from Mail for Windows 10

Reply via email to