I have a document with a field as title having value - Mörder (with an umlaut on o).
When I fetch it in java using the following method the value returned in both the print commands is Morder (with an umlaut on r). Strange.
When I go on to the Web UI provided by Solr the title is Mörder (with an umlaut on o).
Can anyone tell me what is going wrong?
SolrQuery query = new SolrQuery();
query.setParam("q", "<some query>");
query.setStart(start);
query.setRows(rows);
query.setFacet(false);
query.setFields("title");
QueryResponse rsp = server.query(query);
SolrDocumentList sdl = rsp.getResults();
for (SolrDocument sdOl : sdl) {
System.out.println(sdOl.getFieldValue("title"));
System.out.println(new String(sdOl.getFieldValue("title").toString().getBytes, "UTF-8"));
}
EDIT
I am actually comparing document titles from 2 cores. One returns correct umlauts however the other always moves the umlauts to the next character.