Norconex / committer-sql

Implementation of Norconex Committer for SQL (JDBC) databases.
https://opensource.norconex.com/committers/sql/
Apache License 2.0
1 stars 6 forks source link

How to store tagger field to column SQL table when the name is different? #7

Closed LeMoussel closed 4 years ago

LeMoussel commented 4 years ago

In createTableSQL Tag, I can set the fields that are available for the tagger. I.E. the fields that would go here:

<tagger class="com.norconex.importer.handler.tagger.impl.KeepOnlyTagger">
    <fields>title,description,document.reference,google-site-verification</fields>
/tagger>

The fields obtained vary for each document/site. I use DebugTagger to list them.

I create a table like this :

CREATE TABLE ${tableName} (
      ${targetReferenceField} VARCHAR(32672) NOT NULL, 
      ${targetContentField}  CLOB, 
      title VARCHAR(256),
      description VARCHAR(256),
      googleSiteVerification VARCHAR(256),
      PRIMARY KEY ( ${targetReferenceField} )
  )

How to match google-site-verification tagger field to googleSiteVerificationcolumn`?

LeMoussel commented 4 years ago

is the solution to use RenameTagger tag?

Like this:

<tagger class="com.norconex.importer.handler.tagger.impl.RenameTagger">
   <rename fromField="google-site-verification" toField="googleSiteVerification" overwrite="true"/>
</tagger>
essiembre commented 4 years ago

Rename Tagger should do it. Please confirm.

LeMoussel commented 4 years ago

Yes. It's OK.