Then I have created my own searcher-method where I start out my search by instanciating my searcher like this:
var searcher = (MultiIndexSearcher)ExamineManager.Instance.SearchProviderCollection["CombinedIndexSearcher"];
When I now look at my newly created searcher, it tells me that it consists of a StandardAnalyzer, as I have set it to be in my configuration.
But it also has 33 elements in the stopSet property. Now this part is quite alarming for me.
Is there anything I'm doing wrong? Does anyone have any input for why I am getting any stopwords when I have emptied StopAnalyzer.ENGLISHSTOPWORDS_SET
You have set stopanalyzer stopwords however the standardanalyser stop words are still present?
I suspect you may need a new analyser without stopwords or set the standardanalyser stop words to nothing however this may have other un intended consequences?
I think you need new analyser for your custom searcher based on standard but with out stop words?
You have set stopanalyzer stopwords however the standardanalyser stop words are still present?
Yes, that is true
I think you need new analyser for your custom searcher based on standard but with out stop words?
This might very well be the solution that I'm looking for.
But I thought I had already created that / modified the existing standard analyser to do exactly this?
That is on stopanlayser not standard? Unless standard inherits from stop? Also i do not think that will work you need to actually create a new analyser and set stop words there. If you look on forum i do re call someone doing this a couple of years ago. The post had code as well.
using System.Collections;
using Lucene.Net.Analysis.Standard;
using Version = Lucene.Net.Util.Version;
namespace Service.SearchHandler
{
public class MyAnalyzer : StandardAnalyzer
{
public MyAnalyzer() : this(new Hashtable())
{
}
public MyAnalyzer(Hashtable stopwords) : base(Version.LUCENE_29, stopwords)
{
}
}
}
MultiIndexSearcher: Using custom stopwords
I have my CombinedIndexSearcher set up this way:
To test if manually setting my stopwords works, I have tried to remove all of them like this:
Then I have created my own searcher-method where I start out my search by instanciating my searcher like this:
When I now look at my newly created searcher, it tells me that it consists of a StandardAnalyzer, as I have set it to be in my configuration. But it also has 33 elements in the stopSet property. Now this part is quite alarming for me.
Is there anything I'm doing wrong? Does anyone have any input for why I am getting any stopwords when I have emptied StopAnalyzer.ENGLISHSTOPWORDS_SET
Any input is great, I'm kinda stuck atm :/
Squazz,
You have set stopanalyzer stopwords however the standardanalyser stop words are still present?
I suspect you may need a new analyser without stopwords or set the standardanalyser stop words to nothing however this may have other un intended consequences?
I think you need new analyser for your custom searcher based on standard but with out stop words?
Regards
Ismail
Ismail
Yes, that is true
This might very well be the solution that I'm looking for. But I thought I had already created that / modified the existing standard analyser to do exactly this?
You said you have modified standard analyser, however in your config you have
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer
Should that not be set to your custom one?
Regards
Ismail
That's right, I'm using the StandardAnalyzer, but I have also used this code:
Where I remove all of the stop words
That is on stopanlayser not standard? Unless standard inherits from stop? Also i do not think that will work you need to actually create a new analyser and set stop words there. If you look on forum i do re call someone doing this a couple of years ago. The post had code as well.
Regards
Ismail
According to the docs for Lucene.Net then yes, StandardAnalyzer inherits from stop.
I might have to try out creating my own analyzer
I am trying the exact same thing. Right now I am trying to make my own StandardAnalyzer with an empty list of stop-words.
And it seems to work :-)
Web.config
MyAnalyzer.cs
Guys,
See this post https://our.umbraco.org/forum/developers/extending-umbraco/25600-Examine-case-insensitive-keyword-search
Has got code.
Regards
Ismail
That was the link I have been looking for all day long :-)
But me and my colleague is now a tiny little wiser on Lucene.Net.
-Mikkel
is working on a reply...