luceneplusplus / LucenePlusPlus

Lucene++ is an up to date C++ port of the popular Java Lucene library, a high-performance, full-featured text search engine.
luceneplusplus@googlegroups.com
Other
743 stars 235 forks source link

Unable to Use Contrib Analyzers #207

Closed lkimuk closed 1 week ago

lkimuk commented 2 weeks ago

Hello,

I'm using StandardAnalyzer without any issues, but when I try to switch to a contrib analyzer, such as ChineseAnalyzer, I encounter the following error:

undefined reference to `vtable for Lucene::ChineseAnalyzer'
collect2: error: ld returned 1 exit status

I suspect that contrib analyzers are not being properly compiled, as I cannot find these classes in the .so file. Running nm -D /usr/local/lib/liblucene++.so | grep ChineseAnalyzer returns no output.

Could you please advise how to resolve this? Thanks in advance!

lkimuk commented 1 week ago

Finally, I identified the issue. The Contrib components are located in lucene++-contrib.so, so this library needs to be linked as well:

find_library(LUCENEPP_CONTRIB_LIB lucene++-contrib)

Ensure that the Contrib module is enabled during compilation with -DENABLE_CONTRIB=ON. It appears to be enabled by default, but you can confirm this by running cmake .. -L | grep ENABLE_CONTRIB.