0
votes

How can I set the analyzer to the standard analyzer instead of the white space analyzer in a full-text index in Neo4j via the REST api.

I see that there is an "analyzer" property that I can configure, but what should that value be?

I've tried the following and it throws an error when I try to create it, and then leaves a broken index.

{
  "name" : "Standard4",
  "config" : {
    "type" : "fulltext",
    "provider" : "lucene",
 "analyzer": "org.apache.lucene.analysis.standard.StandardAnalyzer"
  }
}

and now all my indexes are erroring and it seems to have blown up all the indexes in neo4j

Hitting this in the REST api with a GET shows:

Caused by: java.lang.InstantiationException: org.apache.lucene.analysis.standard.StandardAnalyzer
    at java.lang.Class.newInstance0(Class.java:340)
    at java.lang.Class.newInstance(Class.java:308)
    at org.neo4j.index.impl.lucene.IndexType.getByClassName(IndexType.java:265)
1

1 Answers

0
votes

It should be the fully qualified class name, so org.apache.lucene.analysis.standard.StandardAnalyzer in this case. Remember that you cannot change index configuration once an index has been created. So create the index with this configuration, i.e. request it the first time with this configuration.