[
https://issues.apache.org/jira/browse/OAK-9875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Mueller updated OAK-9875:
--------------------------------
Component/s: elastic-search
> Prefix query on a Long, analyzed field fails when executed over Elastic
> -----------------------------------------------------------------------
>
> Key: OAK-9875
> URL: https://issues.apache.org/jira/browse/OAK-9875
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: elastic-search, indexing
> Reporter: Nuno Santos
> Priority: Major
>
> Index definition:
> {noformat}
> "testIndex": {
> "jcr:primaryType": "nt:unstructured",
> "analyzed": true,
> "type": "Long",
> "name": "propa"
> }
> {noformat}
> Data:
> {noformat}
> /test/a [propa = 1234 ]
> /test/b [propa = "1234"]
> /test/c [propa = "1234a"]
> {noformat}
> The following query executed with Elastic:
> {noformat}
> /jcr:root//*[jcr:contains(@propa, '123*')]
> {noformat}
> fails with:
> {noformat}
> 14:28:51.713 ERROR [I/O dispatcher 1] ElasticResultRowAsyncIterator.java:326
> Error retrieving data from Elastic: closing scanner, notifying listeners
> co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/search]
> failed: [search_phase_execution_exception] all shards failed
> at
> co.elastic.clients.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:281)
> at
> co.elastic.clients.transport.rest_client.RestClientTransport.access$200(RestClientTransport.java:63)
> {noformat}
> The detailed error is not shown in the logs, but can be found by repeating
> the query directly to Elastic:
> {noformat}
> "Can only use prefix queries on keyword, text and wildcard fields - not on
> [propa] which is of type [long] {noformat}
> The same query executes correctly with Lucene.
> h3. Analysis
> The root cause of the problem is that the Elastic plugin does not create a
> field for full text search on typed properties:
> [https://github.com/apache/jackrabbit-oak/blob/e13d6c7dc5df3087955a85cb28f5bfb8b6171977/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java#L197]
> Therefore, it is not possible to run full text queries on this index.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)