Developer forum

Forum » Templates » Synonyms support in Repositorys

Synonyms support in Repositorys

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

Can anyone provide some instructions on how to get this to work? I know it's an analyzer, but I need to know how/where to populate that list.

 

Best Regards,

Nuno Aguiar


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Yeah - it is kind of secret, right :-). We are bit behind on docs, but here goes!

  1. Create a new field type that uses the "SynonymAnalyzer" in Dynamicweb LuceneIndexProvider. Give it a system name, i.e. WithSynonymAnalyzer (#Dump 1)
  2. Add a new field to index using this new field type. In this test I use the product name and index it using this analyzer. (Dump#2)
  3. Now go to /Files/System/Repositories/{NameOfYourRepository} and create 2 files (find examples attached to this thread (WithSynonymAnalyzer.zip)
    1. A config file that handles what analyzers to use (WithSynonymAnalyzer.config)  (Dump#3)
    2. An xml file containing the list of synonyms (WithSynonymAnalyzer_synonyms.xml) (Dump#4)
    3. These files have names based on the system name of the field defined in the first step. In this way you can have multpile configurations
  4. Add a query expression that uses this new field (Dump#5)
  5. Ensure you have products that uses the synonyms (Example Dump#6)
  6. Run the index after adding the field and the products have words using the synonyms.
  7. You are ready to rock and roll - searching for any of the synonyms will give you products using either of the synonyms (Dump#7)
01SynonymsCreateField.JPG 02SynonymsAddFieldToIndex.JPG 03SynonymsConfigFile.JPG 04SynonymsSynFile.JPG 05SynonymsQueryExpression.JPG 06SynonymsOnProducts.JPG 07SynonymsSearch.JPG
Votes for this answer: 1
 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

 

You must be logged in to post in the forum