How to use analyzers in Lucene Index

50 views
Skip to first unread message

Suhas

unread,
May 14, 2019, 6:07:59 AM5/14/19
to OrientDB

I have a class whose field "title" needs to be pre-tokenized by an underscore instead of space. For example: "title": "Foo_of_Bar_FooBar" into ["Foo", "of", "Bar", "FooBar"]

I used the following to create a full-text index.

CREATE INDEX CLASS
.title_lucene ON CLASS(title)
            FULLTEXT ENGINE LUCENE METADATA
{
               
"analyzer": "org.apache.lucene.analysis.pattern.PatternReplaceCharFilter",
               
"analyzer_pattern": "_",
               
"analyzer_replacement": " ",
               
"index": "org.apache.lucene.analysis.standard.StandardAnalyzer"
           
}


I tried using "pattern" and "replacement" instead of "analyzer_pattern" and "analyzer_replacement". None of them worked. 
How do I pass the arguments to the constructor of the class specified?

The aforementioned class is located here.
Reply all
Reply to author
Forward
0 new messages