More in this section
Forums / General Discussions / set properties for custom fields in search index

set properties for custom fields in search index

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Vince
    Vince avatar
    1 posts
    Registered:
    21 Apr 2016
    09 Oct 2016
    Link to this post

    Hi,

    It seems that all fields that are pushed to be indexed in a back-end search engine are tokenised. I would like one of my custom fields to be non-tokenised by elasticsearch.

    This is a standard feature of elasticsearch and is determined by setting a value of "not_analyzed" on the "index" property for the field. However the index propertyfor a field must be specified either when the index is created, or before any documents have been indexed. Sitefinity is responsible for the creation of the index, and I do not see any handle to customise properties of custom fields. They are all created with a type of "string" and default values for all other properties.

    Is there a way to customise how Sitefinity creates a new index in Elasticsearch, or to change a property of a custom field?

    At the moment, my solution is a manual process. When  using the "re-index" action on an existing index (under "Administration" -> "Search indexes"), which forces the deletion and re-creation of an index in elasticsearch, there is then a window of a few seconds before any documents are pushed in which I can run a command directly on the elasticsearch service to customise my fields -

    curl -XPOST localhost:9200/myindex/_mapping -d'{"properties":{"myCustomField":{"type":"string","index":"not_analyzed"},}}'

    It does work, but it would be much better to have this handled automatically by Sitefinity when it creates the index.

     

    Thank

    Vince

1 posts, 0 answered