Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-97585

Fields that match "expando__keyword__*" are not indexed as keyword

    Details

      Description

      Reproduction steps:

      • Go to Control Panel > Configuration > Custom Fields
      • Create a new field for resource 'Document' with this information:
        Type: 'Text Area'
        Field name: 'myfield'
        Check that 'As Keyword' is selected
        
      • Save the field
      • Create a new document in any site. Under 'Custom Fields' enter 'myvalue' as the text for the 'MyField' field.
      • Publish the document
      • In that site, create a new widget page and add 'Search Bar', 'Search Results' and 'Custom Facet' portlets
      • Enter the 'Custom Facet' configuration and in 'Aggregation Field' input the value
        expando__keyword__custom_fields__myfield.raw
      • Using the search bar, search for the text 'myvalue'

      Expected behavior:
      The document created before is shown in the search results.

      Actual behavior:
      The following exception is shown in the logs:

      2019-06-28 12:00:55.197 ERROR [http-nio-8080-exec-7][ElasticsearchIndexSearcher:169] java.lang.RuntimeException: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed; shardFailures {[0DZLwR-1QxCA_uEQvWhPPA][liferay-20101][0]: RemoteTransportException[[0DZLwR-][127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: IllegalArgumentException[Fielddata is disabled on text fields by default. Set fielddata=true on [expando__keyword__custom_fields__myfield] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.]; }
      java.lang.RuntimeException: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed; shardFailures {[0DZLwR-1QxCA_uEQvWhPPA][liferay-20101][0]: RemoteTransportException[[0DZLwR-][127.0.0.1:9300][indices:data/read/search[phase/query]]]; nested: IllegalArgumentException[Fielddata is disabled on text fields by default. Set fielddata=true on [expando__keyword__custom_fields__myfield] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.]; }
      	at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:288)
      	at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:128)
      	at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:249)
      	at org.elasticsearch.action.search.InitialSearchPhase.onShardFailure(InitialSearchPhase.java:101)
      	at org.elasticsearch.action.search.InitialSearchPhase.access$100(InitialSearchPhase.java:48)
      	at org.elasticsearch.action.search.InitialSearchPhase$2.lambda$onFailure$1(InitialSearchPhase.java:222)
      	at org.elasticsearch.action.search.InitialSearchPhase.maybeFork(InitialSearchPhase.java:176)
      	at org.elasticsearch.action.search.InitialSearchPhase.access$000(InitialSearchPhase.java:48)
      	at org.elasticsearch.action.search.InitialSearchPhase$2.onFailure(InitialSearchPhase.java:222)
      	at org.elasticsearch.action.search.SearchExecutionStatsCollector.onFailure(SearchExecutionStatsCollector.java:73)
      	at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:51)
      	at org.elasticsearch.action.search.SearchTransportService$ConnectionCountingHandler.handleException(SearchTransportService.java:527)
      	at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleException(TransportService.java:1095)
      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:1188)
      	at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:1172)
      	at org.elasticsearch.transport.TaskTransportChannel.sendResponse(TaskTransportChannel.java:66)
      	at org.elasticsearch.action.search.SearchTransportService$6$1.onFailure(SearchTransportService.java:385)
      	at org.elasticsearch.search.SearchService$2.onFailure(SearchService.java:341)
      	at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:335)
      	at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:329)
      	at org.elasticsearch.search.SearchService$3.doRun(SearchService.java:1019)
      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:724)
      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
      	at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41)
      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 weeks ago

                  Packages

                  Version Package
                  7.2.10 DXP FP4
                  7.2.X
                  7.3.0 CE GA1
                  Master