Perform the following steps for indexing document files:
To index office documents, add a new
uploads
section for sample Word and Excel documents. In this case, we will upload a Word document and an Excel spreadsheet as follows:Add the following lines to the indexing function present in
SearchController
, which is present inCommunicationApp/module/Users/src/Users/Controller/SearchController.php
, so that the method picks up and indexes Word documents and Excel spreadsheets separately:if (substr_compare($fileUpload->filename, ".xlsx", strlen($fileUpload->filename) - strlen(".xlsx"), strlen(".xlsx")) === 0) { // index excel sheet $uploadPath = $this->getFileUploadLocation(); $indexDoc = Lucene\Document\Xlsx::loadXlsxFile( $uploadPath ."/" . $fileUpload->filename); } else if (substr_compare($fileUpload->filename, ".docx",...