-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
- I'm trying my hands on custom analyzers for text processing. For reference,State-of-the-art-preprocessing-and-filtering-with-arangosearch is an excellent resource to emphasize on text-processing capabilities of arangosearch with custom analyzers.
- I've tried by defining my analyzer in driver.ArangoSearchElementProperties itself. I've tried it in the following way:
viewName, err := db.CreateArangoSearchView(ctx, myViewName, &driver.ArangoSearchViewProperties{
Links: driver.ArangoSearchLinks{
collectionName: driver.ArangoSearchElementProperties{
AnalyzerDefinitions: []driver.ArangoSearchAnalyzerDefinition{
{
Name: "custom_analyzer",
Type: driver.ArangoSearchAnalyzerTypePipeline,
Properties: driver.ArangoSearchAnalyzerProperties{
Locale: "en_US.utf-8",
Pipeline: []driver.ArangoSearchAnalyzerPipeline{
{
Type: driver.ArangoSearchAnalyzerTypeNorm,
Properties: driver.ArangoSearchAnalyzerProperties{
Locale: "en_US.utf-8",
},
},
{
Type: driver.ArangoSearchAnalyzerTypeNGram,
Properties: driver.ArangoSearchAnalyzerProperties{
Min: utils.NewInt64(1),
Max: utils.NewInt64(14),
PreserveOriginal: utils.NewBool(false),
},
},
},
},
},
},
Fields: map[string]driver.ArangoSearchElementProperties{
"businessName": {
Analyzers: []string{
"text_en",
},
},
"locationName": {
Analyzers: []string{
"text_en",
},
},
},
},
},
})
if err != nil {
log.Println("error creating view: ", err)
}
- Do I need to add my
custom_analyzer
inFields
like:
Fields: map[string]driver.ArangoSearchElementProperties{
"businessName": {
Analyzers: []string{
"text_en",
"custom_analyzer",
},
},
"locationName": {
Analyzers: []string{
"text_en",
"custom_analyzer",
},
},
},
or the underlying analyzer that I'm using, like norm
and ngram
for instance.
- What I want to achieve is to create a
pipeline
type analyzer with underlyingnorm
andngram
analyzers. What I'm trying to achieve is this:
analyzers.save(
'bigram',
'pipeline',
{
pipeline: [
{ type:'norm', properties: { locale:'en', case:'lower'} },
{ type:'ngram', properties: { min:2, max:2, preserveOriginal: false, streamType:'utf8' } }
]
},
["frequency","norm","position"]);
As a side note: I did look at #318 and tried to find a work around
database_arangosearch_analyzers_impl.go
. I'd love any help in this regard.
@maierlars to the rescue, maybe? ;)
Metadata
Metadata
Assignees
Labels
No labels