1

I'm new to Liferay and ElasticSearch. What is the main difference between the Indexer class and IndexWriter class?. I used BaseIndexer for Indexing documents in Elasticsearch. The IndexWriter has some more methods which I believe are used for spell check and suggestions. Please help me to understand the clear difference between these two classes.

Vishnu S Kumar
  • 666
  • 7
  • 24

2 Answers2

1

I won't be able to go in depth with this because my own knowledge is shallow, but I'll answer with what I learned from these docs: https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/introduction-to-liferay-search#indexers

Indexers are for control over what is indexed and how. IndexWriters are for control over when and how the documents are created, updated, deleted.

Russ Bohl
  • 211
  • 1
  • 5
1

So as @Russ Bohl already states the indexer is for indexing documents, but there is a slight difference, I´m missing here...

  • You implement an Indexer when adding search support for your custom liferay asset , which is nearly daily for a liferay developer
  • You implement an IndexWriter if you want to integrate an other search engine, which is quite rare
André
  • 172
  • 13
  • https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/introduction-to-liferay-search#search-adapter-api yes true, IndexWriters are implemented as part of creating an adapter for a search engine, as are IndexSearchers. – Russ Bohl Jun 30 '17 at 02:18