How to make a custom type field not queryable?

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

0 votes

1 answers

1641 views

ANSWER

Guys here is what we already tried.

Set the VCS Configurations

http://doc.nuxeo.com/display/ADMINDOC/VCS+Configuration

&lt;repository name=&quot;arizona&quot; factory=&quot;org.nuxeo.ecm.core.storage.sql.ra.PoolingRepositoryFactory&quot;&gt;

  &lt;pool minPoolSize=&quot;0&quot; maxPoolSize=&quot;20&quot; blockingTimeoutMillis=&quot;100&quot; idleTimeoutMinutes=&quot;10&quot; /&gt;

  &lt;binaryStore path=&quot;/usr/local/nuxeo/nxserver/data-domains/arizona&quot; /&gt;

  &lt;xa-datasource&gt;org.postgresql.xa.PGXADataSource&lt;/xa-datasource&gt;
  &lt;property name=&quot;ServerName&quot;&gt;localhost&lt;/property&gt;
  &lt;property name=&quot;PortNumber&quot;&gt;5432&lt;/property&gt;
  &lt;property name=&quot;DatabaseName&quot;&gt;arizona&lt;/property&gt;
  &lt;property name=&quot;User&quot;&gt;nuxeo&lt;/property&gt;
  &lt;property name=&quot;Password&quot;&gt;nuxeo&lt;/property&gt;

  &lt;indexing&gt;
     &lt;fulltext analyzer=&quot;english&quot;&gt;
       &lt;index name=&quot;default&quot;&gt;
          &lt;excludeField&gt;arizona_informacoesBasicas:palavrasChave&lt;/excludeField&gt;
       &lt;/index&gt;
     &lt;/fulltext&gt;
  &lt;/indexing&gt;

&lt;/repository&gt;

But when we look on the Workbench CMIS the field still Queryable.

&quot;Name&quot;,&quot;Id&quot;,&quot;Description&quot;,&quot;Local Namespace&quot;,&quot;Local Name&quot;,&quot;Query Name&quot;,&quot;Type&quot;,&quot;Cardinality&quot;,&quot;Updatability&quot;,&quot;Queryable&quot;,&quot;Orderable&quot;,&quot;Required&quot;,&quot;Inherited&quot;,&quot;Default Value&quot;,&quot;Open Choice&quot;,&quot;Choices&quot;
&quot;arizona_informacoesBasicas:palavrasChave&quot;,&quot;arizona_informacoesBasicas:palavrasChave&quot;,&quot;arizona_informacoesBasicas:palavrasChave&quot;,,&quot;arizona_informacoesBasicas:palavrasChave&quot;,&quot;arizona_informacoesBasicas:palavrasChave&quot;,STRING,SINGLE,READWRITE,true,true,false,false,,,

Can someone help us ?

alt text

Thanks!

08/26/2014

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.
08/28/2014

I will remember on my next post.
08/28/2014



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.

0 votes



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.

example: test:uuidRegisterField: 434345-543236-3435878-c3545-6575767

So the user is looking for a product called "c3" and this image that contains the hash value "c3" return.

08/28/2014

There are two entirely different things.

If you want the field not to be included in full-text results, then that's done through the &lt;excludeField&gt; configuration you found.

Having the field itself not be marked queryable in CMIS is not possible. But it's a different thing from the above.

08/28/2014

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

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

I will try debug.
08/28/2014