But when i search some phrase on page some time it returns result and some time not. For example if i search "an apomorphine infusion" it return me the result but if i search "apomorphine infusion or a pump" it returns nothing means no result. Both phrase are on same page.
Basically the problem was Standard analyser class omit some words if it is part of phrase which you are searching to solve this I need to write some custom code
Create a class in your project at root - lets say MyMemberAnalyzer.cs
write code in this
namespace YourProject
{
public class MyMemberAnalyzer : StandardAnalyzer
{
private static TextReader stopWords = File.OpenText(HttpContext.Current.Server.MapPath("~/config/LuceneStopWordsForStandardAnalyzer.txt"));
public MyMemberAnalyzer() : base(Lucene.Net.Util.Version.LUCENE_29, stopWords) { }
}
}
Examine search for phrase search
Hi All,
I am using examine search and want to search phrase not the word
I try in two ways
First one like this
But when i search some phrase on page some time it returns result and some time not. For example if i search "an apomorphine infusion" it return me the result but if i search "apomorphine infusion or a pump" it returns nothing means no result. Both phrase are on same page.
I also tried using this way
But it is returning me the same result.
Please suggest me the way to achieve Phrase search or what i am doing wrong.
Manish
Able to solve problem
Basically the problem was Standard analyser class omit some words if it is part of phrase which you are searching to solve this I need to write some custom code
write code in this
"a", "an", "and", "are", "as", "at", "be", "but", "by","for", "if", "in", "into", "is", "no", "not", "of", "on", "or", "such","that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"
and add analyzer like this
Now clear app data folder
Rebuid your index from CMS which you can find under developer > examine management
Now try searching phrase.
Manish
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion