We are trying to implement Search module in SDL DXA 2 and integrate it with the elastic search. When we publish a page which has binary content, from the logs we could find that the binary indexing was taking place first and after that the page content.
- Why is binary indexing taking place before the page indexing?
- Also from the binary indexing process is there a way I can get the page id of the actual page it is residing because I need this info as well for indexing.
- While indexing the page is there any way to get the embedded schema components? For eg: if my page has a component with text fields, date, embedded media schema etc, right now page indexing only provides the text from all these data fields clubbed together. Is there a way I can get other fields like the date, embedded media etc so that I can call the custom methods for binary indexing from here itself?
- Is there any other way to get the media files like pdf or it's component id from the page index?
Log files: We can see that binary indexing is taking place 1st and then page indexing
2018-03-15 13:58:22,637 INFO ElasticIndexer - Adding binaries to elastic.
2018-03-15 13:58:22,637 DEBUG ElasticIndexer - Dispatching binary content to elastic.
2018-03-15 13:58:22,637 INFO ElasticIndexer - Indexing binary with Id: binary:5-4269, and URL Path:/xxx/xxx.pdf
2018-03-15 13:58:22,637 INFO ElasticIndexer - data.getPublicationItemId() 5
2018-03-15 13:58:22,637 INFO ElasticIndexer - data.getIndexUrl() /xxx/xxx.pdf
2018-03-15 13:58:22,637 INFO ElasticIndexer - data.getFileSize() 42025
2018-03-15 13:58:22,637 INFO ElasticIndexer - data.getFileType() pdf
2018-03-15 13:58:22,637 INFO ElasticIndexer - data.getFileName() xxx.pdf
2018-03-15 13:58:25,673 TRACE ElasticIndexer - inside processItemUpdates elastic
2018-03-15 13:58:25,674 INFO ElasticIndexer - Adding pages and component presentations to elastic in batches of 10
2018-03-15 13:58:25,678 INFO ElasticIndexer - Adding Id: tcm:5-304-64
2018-03-15 13:58:25,678 TRACE ElasticIndexer - Adding: summary: xxx.
2018-03-15 13:58:25,678 TRACE ElasticIndexer - Adding: parentsgid: 66
2018-03-15 13:58:25,678 TRACE ElasticIndexer - Adding: itemtype: 64
2018-03-15 13:58:25,679 TRACE ElasticIndexer - Adding: schemaid: 62
2018-03-15 13:58:25,679 TRACE ElasticIndexer - Adding: sgid: 66
2018-03-15 13:58:25,679 TRACE ElasticIndexer - Adding: sgid: 63
2018-03-15 13:58:25,679 TRACE ElasticIndexer - Adding: sgid: 4
2018-03-15 13:58:25,679 TRACE ElasticIndexer - Adding: title: xxx
2018-03-15 13:58:25,679 TRACE ElasticIndexer - Adding: publicationid: 5
2018-03-15 13:58:25,679 TRACE ElasticIndexer - Adding: type: 0
2018-03-15 13:58:25,680 TRACE ElasticIndexer - Adding: body: xxx
2018-03-15 13:58:25,680 TRACE ElasticIndexer - Adding: url: /xxx/xxx/xxx.html
2018-03-15 13:58:25,680 INFO ElasticIndexer - Dispatching documents in 1 steps.
2018-03-15 13:58:25,682 INFO ElasticIndexer - Clearing out registers.
This is how the indexing XML data looks like:
<indexdata>
<url>/xxx/xxx/xxx.html</url>
<title>xxx</title>
<publicationid>5</publicationid>
<schemaid>62</schemaid>
<itemtype>64</itemtype>
<parentsgid>66</parentsgid>
<sgid>66</sgid>
<sgid>63</sgid>
<sgid>4</sgid>
<type>0</type>
<body>xxx</body>
<custom>
<summary>xxx</summary>
</custom>
</indexdata>