enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
201 stars 34 forks source link

Implement node create indexValueProcessors htmlStripper #6659

Closed ComLock closed 3 years ago

ComLock commented 5 years ago

Documented here: http://repo.enonic.com/public/com/enonic/xp/docs/6.15.4/docs-6.15.4-libdoc.zip!/module-node-RepoConnection.html#create

But according to @runarmyklebust not implemented yet.

Future example:

_indexConfig: {
  default: 'byType',
  configs: [{
    path: 'data.response.body',
    config: 'fulltext',
    indexValueProcessors: ['htmlStripper']
  }]
}
vbradnitski commented 4 years ago

@ComLock I'm not sure about provided example, which processor or processors would you expect in next case:

_indexConfig: {
  default: 'byType',
  configs: [{
    path: 'data.response.body',
    config: {
                        "decideByType": false,
                        "enabled": true,
                        "nGram": true,
                        "fulltext": true,
                        "includeInAllText": true,
                        "path": false,
                        "indexValueProcessors": ['processor1']
                    },
    indexValueProcessors: ['processor2']
  }]
}

@GlennRicaud what do you think?

ComLock commented 4 years ago

@vbradnitski I really don't know about indexValueProcessors. The fact there was one called 'htmlStripper' is something @runarmyklebust told me about.

GlennRicaud commented 4 years ago

From what I see the behaviour to set a custom index config is already implemented. Just not documented.

Instead of passing a string 'fulltext', you pass an object. For example for the equivalent of a fulltext with htmlStripper:

_indexConfig: {
  default: 'byType',
  configs: [{
    path: 'data.response.body',
    config:  {
      "decideByType": false,
       "enabled": true,
       "nGram": true,
       "fulltext": true,
       "includeInAllText": true,
       "path": false,
       "indexValueProcessors": ['htmlStripper']
    }
  }]
}
GlennRicaud commented 4 years ago

@ComLock Could you try. We will close this issue then