I have an elasticsearch search implementation working for a webapp but I am stuck on the last detail. I want to be able to filter certain fields alphabetically. So if I query 'd' it should bring back all that begin with 'd' for that field. At the moment this is what I have:
$elasticaQueryString = new Elastica_Query_QueryString();
$elasticaQueryString->setDefaultField('Name');
$elasticaQueryString->setQuery('d'.'*');
It works for fields that have only one work ie 'Dan'. But if there is more than one word then it returns results for each keyword. ie 'Dan Ryan', 'Ryan Dan'. I have also tried a wildcard and prefix query but they give similar results.
Do I need to create a custom analyser or is there some other way around this problem?