Percolator query, is it mandatory to specify mappings for fields explicitly?


(Daniel McGreal) #1

Hi all searchers,
I have an index of documents whose mapping is done dynamically (also via template):
{
"default" : {
"dynamic_templates" : [
{
"not_analyzed" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "keyword"
}
}
}
]
}
}

Next I'd like to use percolator queries on these documents, but I'm running into problems when I index my query:
"No field mapping can be found for the field with name [bizStep]"
This is because I'd rather a) not specify mappings specifically and b) not duplicate the mappings from my document index in my percolator index.

Is it mandatory to specify mappings for fields explicitly within the index storing the queries? When using percolator queries that check against an already indexed document, I find this a weird requirement. Could the check for mapping information a) be moved to query time (and only when presenting unindexed documents) or b) loosened to be able to use dynamic mapping?

Best, Dan.


(system) #2