Hello everybody,

im working with orientdb for a while now and I like it. So first of all: 
Thank you :)
I wanted to use the lucene index since it is fully integrated into orientdb.

I found the description how to use it here: orientdb 
lucene<https://github.com/orientechnologies/orientdb-lucene/wiki>
I also read in an older post here how to change the analyzer:

ODocument metadata = new ODocument();
metadata.field("analyzer", "org.apache.lucene.analysis.en.EnglishAnalyzer");

OrientVertexType type = graph.createVertexType("temp", null);
type.createProperty("name", OType.STRING);
type.createIndex(indexName, "FULLTEXT", null, metadata, "LUCENE", new 
String[] {name});

This works for the EnglishAnalyzer. The problem is that the english and the 
standard analyzer
of lucene does not check for an exact match.

If you for example have the values:


   - software
   - software engineering
   - software development

and you search for 'software' you get all three results: software, software 
engineering and software development.

So i wanted to change the analyzer to KeywordAnalyzer.

ODocument metadata = new ODocument();
metadata.field("analyzer", "org.apache.lucene.analysis.core.KeywordAnalyzer
");

OrientVertexType type = graph.createVertexType("temp", null);
type.createProperty("name", OType.STRING);
type.createIndex(indexName, "FULLTEXT", null, metadata, "LUCENE", new 
String[] {name});

But when i do that, i get the following error:

java.lang.NoSuchMethodException: 
org.apache.lucene.analysis.core.KeywordAnalyzer.<init>(org.apache.lucene.util.Version)
at java.lang.Class.getConstructor0(Class.java:2730)
at java.lang.Class.getConstructor(Class.java:1676)
at 
com.orientechnologies.lucene.manager.OLuceneIndexManagerAbstract.getAnalyzer(OLuceneIndexManagerAbstract.java:326)
at 
com.orientechnologies.lucene.manager.OLuceneFullTextIndexManager.createIndexWriter(OLuceneFullTextIndexManager.java:53)
at 
com.orientechnologies.lucene.manager.OLuceneIndexManagerAbstract.reOpen(OLuceneIndexManagerAbstract.java:126)
at 
com.orientechnologies.lucene.manager.OLuceneIndexManagerAbstract.initIndex(OLuceneIndexManagerAbstract.java:114)
at 
com.orientechnologies.lucene.manager.OLuceneIndexManagerAbstract.createIndex(OLuceneIndexManagerAbstract.java:99)
at 
com.orientechnologies.lucene.OLuceneIndexEngine.create(OLuceneIndexEngine.java:60)
at 
com.orientechnologies.orient.core.index.OIndexAbstract.create(OIndexAbstract.java:219)
at 
com.orientechnologies.orient.core.index.OIndexMultiValues.create(OIndexMultiValues.java:235)
at 
com.orientechnologies.lucene.index.OLuceneFullTextIndex.create(OLuceneFullTextIndex.java:45)
at 
com.orientechnologies.lucene.index.OLuceneFullTextIndex.create(OLuceneFullTextIndex.java:32)
at 
com.orientechnologies.orient.core.index.OIndexManagerShared.createIndex(OIndexManagerShared.java:143)
at 
com.orientechnologies.orient.core.index.OIndexManagerProxy.createIndex(OIndexManagerProxy.java:75)
at 
com.orientechnologies.orient.core.metadata.schema.OClassImpl.createIndex(OClassImpl.java:1154)
at 
com.orientechnologies.orient.core.metadata.schema.OClassAbstractDelegate.createIndex(OClassAbstractDelegate.java:291)

Is there a method or a constructor or something missing for the 
KeywordAnalyzer?
How can i fix this problem?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to