![]() ![]() StringBuffer stringBuffer = new StringBuffer() ĭoc.add(new TextField("contents", stringBuffer.toString(), Field.Store. Document doc = new .Document() ĭoc.add(new TextField("path", file.getName(), )) įileInputStream is = new FileInputStream(file) īufferedReader reader = new BufferedReader(new InputStreamReader(is)) This query needs to be parsed in Apache Lucene query, and then sent to the search facade. This is a spring server, on the endpoint of which the search request comes - the fields to search for, and their values. IndexWriter indexWriter = new IndexWriter(directory, config) įile f = new File("/home/akshay/textfiles/") // current directory 1 I'm developing my own service based on Apache Lucene. IndexWriterConfig config = new IndexWriterConfig(new SimpleAnalyzer()) Path path = Paths.get("/home/akshay/index/") ĭirectory directory = .FSDirectory.open(path) What am I doing wrong?ĮrrorLog : Caused by: : org/apache/lucene/search/similarities/DefaultSimilarityĪt .SearchIntegratorBuilder.createCleanFactoryState(SearchIntegratorBuilder.java:287)Īt .SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:186)Īt .SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:117)Īt .圜reated(HibernateSearchSessionFactoryObserver.java:66)Īt .sessionFactor圜reated(SessionFactoryObserverChain.java:52)Īt .(SessionFactoryImpl.java:588)Īt .buildSessionFactory(Configuration.java:1859)Īt .buildSessionFactory(Configuration.java:1930)Īt 4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:372)Īt 4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:454)Īt 4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:439)Īt .(AbstractAutowireCapableBeanFactory.java:1633)Īt .(AbstractAutowireCapableBeanFactory.java:1570)Ĭaused by: : .similarities.DefaultSimilarityĪt .WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858)Īt .WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701) I tried adding the lucene-queries, but that didn't help. Unfortunately, I am having problem with missing libraries. Sources for JCC are included with the PyLucene sources. PyLucene is built with JCC, a C++ code generator that makes it possible to call into Java classes from Python via Javas Native Invocation Interface (JNI). I am working on testing Apache lucene for text based search in our project. The PyLucene Python extension, a Python module called lucene is machine-generated by JCC.
0 Comments
Leave a Reply. |