outr / lucene4s

Light-weight convenience wrapper around Lucene to simplify complex tasks and add Scala sugar.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

custom stopwords

bogorman opened this issue · comments

Is there a way to customise the stopwords. I see the StandardAnalyzer is created with no params so it will default to the standard set of stop words and I have no way to change that.

When you instantiate KeywordIndexing you can provide a custom stopWords: Set[String].

Ah, sorry, I misunderstood what you were referring to. That's a good point. If you'd like to submit a PR that adds support to Lucene to take a custom stopWords list I'll be happy to merge it in.

OK. For the moment I have just created a custom lucene version which works for what I need but it would be cleaner to have it as a constructor param.

class CustomLucene() extends Lucene(defaultFullTextSearchable = true, directory = None) { override lazy val standardAnalyzer = new StandardAnalyzer(CharArraySet.EMPTY_SET) }

Give me a couple minutes, this is actually an easy update. :)

Take a look at that commit. Does it fulfill your needs completely?

@bogorman please let me know if the commit I made resolves your issue and I'll do another release.

looks good. thanks.