Alfresco FTS Query on MultipleValue custom property

cancel
Showing results for 
Search instead for 
Did you mean: 
Lvit
Member II

Alfresco FTS Query on MultipleValue custom property

Hi,

i have a Custom Model with a MultiValue custom property, like this:

<property name="sdoc:configurators">
                    <title>Configuratori</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <multiple>true</multiple>
                    <index enabled="true">
                        <tokenised>TRUE</tokenised>
                        <facetable>false</facetable>
                    </index>
                </property>

This property is populated with Strings like:

Document1 --> ["VALUE", "AAAA", "BBBB"]

Document2 --> ["VALUE1", "XXXXX", "YYYYYY"]

Document3 --> ["VALUEZZZ", "CCCC"]

Document4 --> ["DDDD", "EEEEE"]

I need to find all documents with an exact value in this property. My FTS query is:

(PATH:'my-path//*') AND (=cm:content.mimetype:application/pdf) AND (TYPE:'sdoc:mydoc') AND (-EXISTS:'sdoc:configurators') AND =sdoc:configurators:'VALUE'

I expect to find ONLY Document1 (the only with exact value "VALUE"), but my FTS result is Document1, Document2 and Document3.

Obviously it happens because these three documents contain the sub-string "VALUE". How can i match only the documents that match exactly the string "VALUE"?

 

Thanks!

1 Reply
sufo
Established Member II

Re: Alfresco FTS Query on MultipleValue custom property

Maybe depends on Alfresco version (https://hub.alfresco.com/t5/alfresco-content-services-blog/exact-term-queries-in-search-services-2-0...) and also on cross-language settings (https://docs.alfresco.com/search-services/latest/install/options/). You can try nasty hack and add also this to your search 

AND sdoc:configurators:'?????'

It should match exactly 5 character long values (length of string VALUE).

Anyway, why are you using -EXISTS:'sdoc:configurators' ?  The '-' means do not match.