cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a custom type field not queryable?

fabioaraujo_
Champ in-the-making
Champ in-the-making

Hi, how can I make a field not queryable, not indexed?

I've created a custom type.

<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
    <doctype name="custom:asset" extends="Document">
        <schema name="common"/>
        <schema name="dublincore"/>
        <schema name="custom-asset"/>
    </doctype>
</extension>

<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
    <schema name="custom-asset" src="schemas/custom-asset.xsd" prefix="customAsset" />
</extension>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:nxs="http://example.com.br/contenttypes/schemas/custom-asset/"
           targetNamespace="http://example.com.br/contenttypes/schemas/custom-asset/">
    <xs:element name="fieldNotQueryable" type="xs:string"/>
</xs:schema>

Previus version, I could do something like this:

<extension target="org.nuxeo.ecm.core.search.service.SearchServiceImpl" point="resource">
    <resource name="custom-asset" prefix="customAsset" indexAllFields="true" type="schema">
        <field name="fieldNotQueryable" stored="true" indexed="false" type="Text" binary="false" sortable="true"/>
    </resource>
</extension>

Thanks in advance. Fabio

9 REPLIES 9

Rafael_Bueno
Confirmed Champ
Confirmed Champ

Guys here is what we already tried.

Florent_Guillau
World-Class Innovator
World-Class Innovator

This is not an answer, so don't add it as an answer. Instead edit your original question to add details/clarification. I moved this to a comment.

Florent_Guillau
World-Class Innovator
World-Class Innovator

What is the purpose of not making a field queryable? Some kind of security restriction?

You seem to want the field marked not queryable at the CMIS level. There is currently no configuration for this, all fields are queryable.

Actually we have some fields that are recorded technical information, which does not have any value to business, so when a user searches for a file he ends up finding files that do not make sense to him.

There are two entirely different things.

Florent, but why using the excludeField the field still return on CONTAINS('c3') query ? Im using mult repository solution, thats a problem ?

Then maybe the exact syntax used for configuration is wrong... Debugging inside Model.inferFulltextInfo would help if you have source code and a debugger.

I will try debug.

Rafael_Bueno
Confirmed Champ
Confirmed Champ

I will remember on my next post.