Ok, I think you have two problems.
Problem 1:
You look to me like you are using pre 10.0 typeahead API. To use remote, you have to use Bloodhound or something like it to fetch your results.
I implemented this recently, and here is a working example:
var $vartypeahead = $(yourjqueryelement);
var engine = new Bloodhound({
name: 'typeaheads',
remote: {"url":'/search/typeahead?q=%QUERY'},
datumTokenizer: function(d) { return d;},
queryTokenizer: function(d) { return d;}
});
engine.initialize();
$vartypeahead.typeahead({
"minLength": 2,
"highlight": true
},
{
"source": engine.ttAdapter()
});
I did have to modify the above slightly from what I've done; I use backbone on the frontend and splice the above into it (I have a PR at the typeahead project for that)
Problem #2
As far as ES goes, I'm not sure you have your mappings right, usually your mapping for a typeahead project is going to look something like this:
{
"settings": {
"analysis": {
"filter": {
"autocomplete_ngram": {
"max_gram": 24,
"min_gram": 2,
"type": "edge_ngram"
}
},
"analyzer": {
"autocomplete_index": {
"filter": [
"lowercase",
"autocomplete_ngram"
],
"tokenizer": "keyword"
},
"autocomplete_search": {
"filter": [
"lowercase"
],
"tokenizer": "keyword"
}
}
},
"index": {
"number_of_shards": 20,
"number_of_replicas": 1
}
},
"mappings": {
"yourtype": {
"properties": {
"title": {
"type": "multi_field",
"fields": {
"title_edgengram": {
"type": "string",
"index": "analyzed",
"index_analyzer": "autocomplete_index",
"search_analyzer": "autocomplete_search"
},
"title": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
}