Pretty sure that I'm doing some huge mistake, but I have no clue how to sort it.
My couchdb river and my index are defined as following:
curl -XPUT 'localhost:9200/_river/my_index/_meta' -d '{
"type" : "couchdb",
"couchdb" : {
"host" : "localhost",
"port" : 5984,
"db" : "my_db",
"filter" : null
},
"index" : {
"index" : "my_index",
"type" : "my_index_type",
"bulk_size" : "100",
"bulk_timeout" : "10ms",
"analysis": {
"analyzer": {
"tags_analyzer": {
"type" : "custom",
"tokenizer": "lowercase",
"filter": ["lowercase", "asciifolding"]
}
}
}
},
"mappings": {
"tags": {
"properties": {
"tags": {
"type": "string",
"analyzer": "tags_analyzer",
"boost": 10
}
}
}
}}'
The query is performed through JAVA application:
QueryStringQueryBuilder queryBuilder = QueryBuilders.queryString(req.getParameter("tags"));
queryBuilder.defaultField("tags");
queryBuilder.analyzer("tags_analyzer");
queryBuilder.analyzeWildcard(true);
queryBuilder.lowercaseExpandedTerms(true);
queryBuilder.defaultOperator(QueryStringQueryBuilder.Operator.AND);
SearchResponse response = client.prepareSearch("idxscopus").setSearchType(SearchType.QUERY_THEN_FETCH).setQuery(queryBuilder)
.addHighlightedField("tags", 0, 0)
.setFrom(0).setExplain(true).execute().actionGet();
During the query phase I'm facing a QueryParsingException telling that my custom analyzer is missing:
omqueryery_stringb*default_fieldCtagsdefault_operatorBandanalyzerLtags_analyzerlowercase_expanded_terms#analyze_wildcard#xplain#highlighteldsgsagment_sizenumber_of_fragments;]]]; nested: QueryParsingException[[idxscopus] [query_string] analyzer [tags_analyzer] not found]; }{[BtMQ0EBJQVmFKyJTJMVhSA][idxscopus][1]: RemoteTransportException[[Aardwolf][inet[/10.1.1.2:9300]][search/phase/query]]; nested: SearchParseException[[idxscopus][1]: from[0],size[-1]: Parse Failure [Failed to parse source [:)
What I'm doing wrong? I really need the asciifolding feature on index and search phase.
Thanks!