Indexing and searching special characters java

I need to index the my documents as they are without removing the special characters. I also need to search for the exact phrase such as: s**
When I search for s** using mathphrase query it removes ** from the phrase and searches only for s.
I also don't know how to use analyzer and tokenizers in my java code. Please explain that as well.
This is the java code I use to create my index.
i> ndent preform IndicesAdminClient indicesAdminClient = client.admin().indices();

            indicesAdminClient.prepareCreate(elasticSearch.productIndexName)
                    .setSettings(Settings.builder()
                            .put("index.mapping.total_fields.limit", indexFieldLimit)
                            .put("refresh_interval", -1)
                            .put("index.number_of_replicas",0))
                            .get();

This is my search query code -

boolQuery.must(multiMatchQuery(bannedKeyword).type(MatchQuery.Type.PHRASE));

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.