Search with commas in multi value text field

cancel
Showing results for 
Search instead for 
Did you mean: 
viktoriyamoskov
Active Member

Search with commas in multi value text field

Good day.
 I have a custom type, defined with a multi value propertie named imus:toirCodesProperty
defined as:
<
property name="imus:toirCodesProperty">
<title>toirCodesProperty</title>
<type>d:text</type>
<multiple>true</multiple>
</property>
I have configured advanced search, and the relevant part of my share-config-custom.xml 
looks like this:

<
field id="imus:toirCodesProperty" label-id="prop.imus_toirCodesProperty">
<control template="/org/alfresco/components/form/controls/textarea.ftl"/>
</field>

If I perform a search with commas, then I get an empty result.
The query:
query=TYPE:"imus:attachment" AND (imus:toirCodesProperty:(1234, 1785)).

But if I enter a logical operator in the control, the query succeeds.
The query:
query=TYPE:"imus:attachment" AND (imus:toirCodesProperty:(1234 or 1785)).

Can commas be used for searching in multi value text field?

Thank you.
1 Reply
spino
Active Member II

Re: Search with commas in multi value text field

Hi,

The comma in the Apache Lucene Query Parser Is not managed as you can see in the official documentazione ( Apache Lucene - Query Parser Syntax ).

For properties that are multiple, you need to repeat the name of the property for each value are you searching for.

I Hope i was helpful,

Bye