writeDoc
Writes the document to the directory using a segment named "test"; returns the SegmentInfo describing the new segment
fun writeDoc(dir: Directory, analyzer: Analyzer, similarity: Similarity?, doc: Document): SegmentCommitInfo
Writes the document to the directory using the analyzer and the similarity score; returns the SegmentInfo describing the new segment