Elasticsearch prefix query case insensitive using java API


(Suhail Mehgal) #1

I wrote a method to search prefix:
its working for case sensitive. How i can achieve case insensitive prefix method?

public static SearchResponse search(String indexName,String indexType,String key,String value , Client client) {

    QueryFilterBuilder qb =   FilterBuilders.queryFilter(QueryBuilders.prefixQuery(key, value));  
    return client.prepareSearch(indexName)
            .setTypes(indexType)
            .setSearchType(SearchType.DFS_QUERY_AND_FETCH)
            .setQuery(QueryBuilders.filteredQuery(QueryBuilders.prefixQuery(key, value), qb)).execute()
            .actionGet();
}

(Fabioebner) #2

can u resolve this?? how?? tks


(system) #3