Jackie-Jiang commented on a change in pull request #5667: URL: https://github.com/apache/incubator-pinot/pull/5667#discussion_r451711537
########## File path: pinot-core/src/main/java/org/apache/pinot/core/segment/creator/impl/inv/text/LuceneTextIndexCreator.java ########## @@ -115,14 +115,31 @@ public IndexWriter getIndexWriter() { @Override public void addDoc(Object document, int docIdCounter) { - Document docToIndex = new Document(); - docToIndex.add(new TextField(_textColumn, document.toString(), Field.Store.NO)); - docToIndex.add(new StoredField(LUCENE_INDEX_DOC_ID_COLUMN_NAME, docIdCounter)); - try { - _indexWriter.addDocument(docToIndex); - } catch (Exception e) { - LOGGER.error("Failure while adding a new document to index for column {}, exception {}", _textColumn, e.getMessage()); - throw new RuntimeException(e); + if (!(document instanceof Object[])) { + // text index on SV column + Document docToIndex = new Document(); + docToIndex.add(new TextField(_textColumn, document.toString(), Field.Store.NO)); + docToIndex.add(new StoredField(LUCENE_INDEX_DOC_ID_COLUMN_NAME, docIdCounter)); + try { + _indexWriter.addDocument(docToIndex); + } catch (Exception e) { + LOGGER.error("Failure while adding a new document to index for column {}, exception {}", _textColumn, e.getMessage()); + throw new RuntimeException(e); + } + } else { + // text index on MV column + Object[] values = (Object[])document; + for (Object value : values) { + Document docToIndex = new Document(); Review comment: Will this cause multiple text document map to the same pinot document? How do you maintain the map? We need to figure out the semantic of text index on MV columns ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org