<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Facet searcher is returning Chinese characters array for localised field</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121514765" />
  <subtitle>Facet searcher is returning Chinese characters array for localised field</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121514765</id>
  <updated>2026-04-03T23:25:17Z</updated>
  <dc:date>2026-04-03T23:25:17Z</dc:date>
  <entry>
    <title>RE: Facet searcher is returning Chinese characters array for localised field</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121515400" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121515400</id>
    <updated>2022-09-19T16:24:05Z</updated>
    <published>2022-09-15T13:45:28Z</published>
    <summary type="html">&lt;p&gt;Hi Prashant, can you try to clarify your question better? In your
  post title you're talking about Chinese characters being returned,
  while your post doesn't seem to mention anything related. I probably
  won't be the expert to help you here but you may get a better answer
  if you clean up the question and make it clear what you are trying to
  do and what's not working.&lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2022-09-15T13:45:28Z</dc:date>
  </entry>
  <entry>
    <title>Facet searcher is returning Chinese characters array for localised field</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121514764" />
    <author>
      <name>Prashant Ballal</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121514764</id>
    <updated>2022-09-16T17:41:20Z</updated>
    <published>2022-09-14T16:51:22Z</published>
    <summary type="html">&lt;p&gt;I am using 7.4 u 31 with MySQL. I am adding a field as a keyword in
  the indexer document. As shown below:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;document.addLocalizedKeyword(FIELD_NAME, FIELD_VALUE, false, true);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;as I debugged a code I can see the field is stored in the document as
  null. But when I was debugging the Liferay source in populate method
  in class DefaultSearchResponseTranslator I can see below field name as below:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;quot;FIELD_NAME_en_GB_sortable&amp;quot;: [
      &amp;quot;KkhITEZUMjABDAHcCwA=&amp;quot;
    ],&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;when I remove _sortable from the field name I am getting the below
  error even if I am using the keyword field already:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;pre&gt;
Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;I am using below code to get the search filter facets:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;FacetedSearcher createFacetedSearcher = facetedSearcherManager.createFacetedSearcher();
		searchContext.setFacets(facets);
		createFacetedSearcher.search(searchContext);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Can anyone please sugesst what could be the issue.&lt;/p&gt;
&lt;p&gt;In postman, I am getting below response on _search URL:&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;&amp;quot;aggregations&amp;quot;: {
        &amp;quot;FIELD_NAME_en_GB_sortable&amp;quot;: {
            &amp;quot;doc_count_error_upper_bound&amp;quot;: 0,
            &amp;quot;sum_other_doc_count&amp;quot;: 0,
            &amp;quot;buckets&amp;quot;: [
                {
                    &amp;quot;key&amp;quot;:&amp;quot;ᜠᆓ䙆倎瀤��&amp;quot;,
                    &amp;quot;doc_count&amp;quot;: 3
                },
                {
                    &amp;quot;key&amp;quot;:&amp;quot;⌤಑!怸��&amp;quot;,
                    &amp;quot;doc_count&amp;quot;: 3
                },
                {
                    &amp;quot;key&amp;quot;:&amp;quot;ᔤሓ࣊䌣\b〇㠖��&amp;quot;,
                    &amp;quot;doc_count&amp;quot;: 2
                },
                {
                    &amp;quot;key&amp;quot;:&amp;quot;∣ᐁو䑥ᆱ怐璈㑆☡ઔ݈摀࣐ݳ޹䃜܀��&amp;quot;,
                    &amp;quot;doc_count&amp;quot;: 2
                },
                {
                    &amp;quot;key&amp;quot;:&amp;quot;᠙ஐ݈䌣\b〇㠖��&amp;quot;,
                    &amp;quot;doc_count&amp;quot;: 1
                }
            ]
        }
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Prashant Ballal</dc:creator>
    <dc:date>2022-09-14T16:51:22Z</dc:date>
  </entry>
</feed>
