Dzung Bui

Results 39 comments of Dzung Bui
trafficstars

@msfroh As you only need to write the FST metadata, there is no need to create the FST. You can just call ``` directory.writeMetadata(words.size(), maxHorizontalContext, fstMetadata); ``` where as `fstMetadata`...

You are right, the saveMetadata is still in FST. Now to create the FST written off heap, you need to create the corresponding DataInput and use the FST constructor. However...

I could put a PR for the saveMetadata change if you prefer.

I realized I also need the `saveMetadata` change for https://github.com/apache/lucene/pull/12985. Do you think we should make it a standalone PR and merge first? Otherwise I've cherry-picked from this PR :)

@msfroh I also forgot about this. Let me create a PR

I published a PR here: https://github.com/apache/lucene/pull/13549. Please take a look when you have time!

Note: The above PR has been merged

I found another quite tricky issue: If we write the FST directly to the IndexOutput, there might be a chance that there's no term accepted by the FST, in that...

There is only 1 failed test left: TestFSTPostingFormat.testRandomException ``` > Caused by: > java.lang.RuntimeException: unclosed IndexOutput: _s_FST50_0.tfp.meta > at org.apache.lucene.tests.store.MockDirectoryWrapper.addFileHandle(MockDirectoryWrapper.java:783) ``` Seems like some file might not be closed correctly...

Fixed the above unclosed issue by moving `openInput` and `createOutput` to try-catch block The test passed. I'll add a change log, some more comments