# Help java client search

**URL:** <https://discuss.elastic.co/t/help-java-client-search/39656>\
**Category:** Elasticsearch\
**Created:** [January 20, 2016, 1:18pm UTC](https://discuss.elastic.co/t/help-java-client-search/39656 "2016-01-20T13:18:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabio\_Ebner](https://avatars.discourse-cdn.com/v4/letter/f/ccd318/32.png) [@Fabio\_Ebner](https://discuss.elastic.co/u/Fabio_Ebner)\
**Post date:** [January 20, 2016, 1:18pm UTC](https://discuss.elastic.co/t/help-java-client-search/39656/1 "2016-01-20T13:18:24Z")

</div>

I have this index.:

```
{
  "aliases" : {
    "imoveislogradouro" : {}
  },
    "mappings" : {
      "imoveislogradourotype" : {
        "properties" : {
          "logradouro" : {
            "type" : "string",
            "analyzer" : "phoneticAnalyzer"
          },
          "logradourosNaoFoneticado" : {
            "type" : "string",
            "analyzer" : "naoFoneticado"
          }
        }
      }
    },
    "settings" : {
      "index" : {
        "analysis" : {
          "filter" : {
            "beider_morse" : {
              "languageset" : ["portuguese", "french", "english", "german"],
              "type" : "phonetic",
              "encoder" : "beider_morse"
            }
          },
          "analyzer" : {
            "phoneticAnalyzer" : {
              "filter" : ["asciifolding","standard", "lowercase", "stemmer", "beider_morse"],
              "type" : "custom",
              "tokenizer" : "standard"
            },
            "naoFoneticado" : {
              "filter" : ["asciifolding","standard", "lowercase"],
              "type" : "custom",
              "tokenizer" : "standard"
            }
          }
        }
      }
    }
}

```

so I need to find one logradouro even if input only the start of my word ( if I input "san" the elastic need to return Santos, Santana ....  
But I need to look for phonetic too, because this I create 2 fields, one Phonetic and another withou Phonetic

I using this code to find but dont return anything:

```
private List<Map<String, Object>> search(String where, String what) throws Exception{
		QueryBuilder query = QueryBuilders.multiMatchQuery(what, where, where+"NaoFoneticado");
		SearchResponse response = client.prepareSearch(this.getIndex())
				.setTypes(this.getType())
				.setQuery(query)
				.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
				.setSize(this.getSize()).execute()
				.actionGet();
		
		SearchHit[] hits = response.getHits().getHits();
		List<Map<String, Object>> retorno = new ArrayList<Map<String, Object>>();

		for (int i = 0; i < hits.length; i++) {
			retorno.add(hits[i].getSource());
		}
		return retorno;
	}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:23pm UTC](https://discuss.elastic.co/t/help-java-client-search/39656/2 "2017-07-05T23:23:02Z")

</div>


