azagniotov commented on PR #935: URL: https://github.com/apache/lucene-solr/pull/935#issuecomment-1694866116
> Yes if you want to revive the discussion, please move the PR over to the lucene git repo. I'm a little unclear on the future of this though. So far it's a pretty expert feature. To use it you have to edit the gradle build script and rebuild Lucene, right? @msokolov hello! Thank you. Yes, I figured that PR will need to be exported eventually under the right repo, thus, I went ahead and did it: - https://github.com/apache/lucene/pull/12517 To use this feature, yes, Lucene analysis Kuromoji JAR will have to be rebuilt after rebuilding a new dictionary. For example, while under the root lucene/ directory where the `gradlew` file is: 1. Run the: [./gradlew compileUnidic](https://github.com/apache/lucene/pull/12517/commits/bc9d2e3bb38d096ad193ce41e46c644b4c5673f9) (added in my PR). This will download and compile [unidic 3.1.1](https://github.com/apache/lucene/pull/12517/commits/bc9d2e3bb38d096ad193ce41e46c644b4c5673f9#diff-6bc685fcad3afe3dbc3692590a442b98efa1ae2912edc332fecbf8c8792b9333R142-R145) and will put the generated `*.dat` files under [the resources directory ](https://github.com/apache/lucene/tree/main/lucene/analysis/kuromoji/src/resources/org/apache/lucene/analysis/ja/dict)of the kuromoji package 2. To create a new Lucene analysis Kuromoji JAR with the new `*.dat` files, just run `./gradlew assemble`. #### To extend this example a little further, more specifically - using this together with Solr My aforementioned [PR under Lucene](https://github.com/apache/lucene/pull/12517) adds the new changes using the latest state of code from the `main` branch. If you are running Solr in Docker, then the PR changes must be adapted to the Lucene v9.7.0 branch, which is what the latest Solr is running on. This is something that I have done when I was rebuilding and testing the Lucene library. I have a patch [lucene_9.7.0_kuromoji_unidic_3_compatibility](https://gist.githubusercontent.com/azagniotov/8ed7d2d627199cd4365ae979aabd9575/raw/99e690f6c2bc2d059a7b416ee236ba546637a8ce/lucene_9.7.0_kuromoji_unidic_3_compatibility.patch) that adapts the PR changes to the v9.7.0 branch. Thus, doing the above steps inside the Dockerfile, you could then replace the default Solr's `lucene-analysis-kuromoji-9.7.0` JAR after rebuilding it: ``` ... ... ENV SOLR_JAVA_MEM="-Xms2g -Xmx2g" ENV SOLR_LIB_HOME=/opt/solr/server/solr-webapp/webapp/WEB-INF/lib USER root RUN rm $SOLR_LIB_HOME/lucene-analysis-kuromoji-*.jar COPY ./lucene/analysis/kuromoji/build/libs/lucene-analysis-kuromoji-9.7.0-SNAPSHOT.jar $SOLR_LIB_HOME/ ... ... USER solr ``` -- 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