You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicemix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2017/06/26 15:23:01 UTC

[jira] [Assigned] (SMX4NMR-237) LuceneAuditor - unable to search by exact property value

     [ https://issues.apache.org/jira/browse/SMX4NMR-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet reassigned SMX4NMR-237:
---------------------------------------

    Assignee:     (was: Guillaume Nodet)

> LuceneAuditor - unable to search by exact property value
> --------------------------------------------------------
>
>                 Key: SMX4NMR-237
>                 URL: https://issues.apache.org/jira/browse/SMX4NMR-237
>             Project: ServiceMix NMR
>          Issue Type: Bug
>    Affects Versions: 1.3.0
>            Reporter: Albert Tumanov
>         Attachments: patch.txt
>
>
> When exchange contains a property like:
>   properties: [
>       correlationId = aec94f2c-8763-4bd0-938d-e9cbb8d36a74
>   ]
> and LuceneAuditor is configured to log the exchange, the log is created but not searchable:
> smx@root> audit:find "correlationId:aec94f2c-8763-4bd0-938d-e9cbb8d36a74"
> No matching exchanges
> The reason is that LuceneAuditor uses Field.Index.ANALYZED when building Lucene index for exchange properties:
>     protected void addExchangePropertiesToDocument(Exchange exchange,
>                                                    Document document) {
>         for (Map.Entry<String,Object> entry : exchange.getProperties().entrySet()) {
>             if (entry.getValue() instanceof String) {
>                 document.add(new Field(FIELD_PROPERTIES + "." + entry.getKey(), (String) entry.getValue(), Field.Store.YES, Field.Index.ANALYZED));
>             }
>         }
>     }
> So that the value "aec94f2c-8763-4bd0-938d-e9cbb8d36a74" gets broken up into words "aec", "bd", etc, 
> and there is no index for exactly "aec94f2c-8763-4bd0-938d-e9cbb8d36a74".
> One possible solution is to index twice: once using Field.Index.ANALYZED and once using Field.Index.NOT_ANALYZED.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)