rmuir commented on code in PR #12054:
URL: https://github.com/apache/lucene/pull/12054#discussion_r1068060646


##########
lucene/demo/src/java/org/apache/lucene/demo/IndexFiles.java:
##########
@@ -234,8 +234,8 @@ void indexDoc(IndexWriter writer, Path file, long 
lastModified) throws IOExcepti
       // field that is indexed (i.e. searchable), but don't tokenize
       // the field into separate words and don't index term frequency
       // or positional information:
-      Field pathField = new StringField("path", file.toString(), 
Field.Store.YES);
-      doc.add(pathField);
+      doc.add(new KeywordField("path", file.toString()));
+      doc.add(new StoredField("path", file.toString()));

Review Comment:
   > If you also need to store the value, you should add a separate {@link 
StoredField} instance.
   
   Let's rethink this for the new fields we are adding. I think storing is 
quite common and offering Field.Store.YES/NO is the best choice.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to