Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6080465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:03:52+00:00 2026-05-23T11:03:52+00:00

when i query for elegant in solr i get results for elegance too. I

  • 0

when i query for “elegant” in solr i get results for “elegance” too.

I used these filters for index analyze

WhitespaceTokenizerFactory
StopFilterFactory
WordDelimiterFilterFactory
LowerCaseFilterFactory
SynonymFilterFactory
EnglishPorterFilterFactory
RemoveDuplicatesTokenFilterFactory
ReversedWildcardFilterFactory

and for query analyze:

WhitespaceTokenizerFactory
SynonymFilterFactory
StopFilterFactory
WordDelimiterFilterFactory
LowerCaseFilterFactory
EnglishPorterFilterFactory
RemoveDuplicatesTokenFilterFactory 

I want to know which filter affecting my search result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:03:53+00:00Added an answer on May 23, 2026 at 11:03 am

    EnglishPorterFilterFactory

    Thats the short answer 😉

    A little more information:

    English Porter means the english porter stemmer stemming alogrithm. And both elegant and elegance have according to the stemmer (which is a heuristical word root builder) the same stem.

    You can verify this online e.g. Here. Basically you will see “eleg ant ” and “eleg ance” stemmed to the same stem > eleg.

    From Solr source:

           public void inform(ResourceLoader loader) {
                String wordFiles = args.get(PROTECTED_TOKENS);
                if (wordFiles != null) {
                    try {
    

    Here exactly comes the protwords file into play:

                        File protectedWordFiles = new File(wordFiles);
                        if (protectedWordFiles.exists()) {
                            List<String> wlist = loader.getLines(wordFiles);
                            //This cast is safe in Lucene
                            protectedWords = new CharArraySet(wlist, false);//No need to go through StopFilter as before, since it just uses a List internally
                        } else {
                            List<String> files = StrUtils
                                    .splitFileNames(wordFiles);
                            for (String file : files) {
                                List<String> wlist = loader.getLines(file
                                        .trim());
                                if (protectedWords == null)
                                    protectedWords = new CharArraySet(wlist,
                                            false);
                                else
                                    protectedWords.addAll(wlist);
                            }
                        }
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
    

    Thats the part which affects the stemming. There you see the invocation of the snowball library

            public EnglishPorterFilter create(TokenStream input) {
                return new EnglishPorterFilter(input, protectedWords);
            }
    
        }
    
        /**
         * English Porter2 filter that doesn't use reflection to
         * adapt lucene to the snowball stemmer code.
         */
        @Deprecated
        class EnglishPorterFilter extends SnowballPorterFilter {
            public EnglishPorterFilter(TokenStream source,
                    CharArraySet protWords) {
                super (source, new org.tartarus.snowball.ext.EnglishStemmer(),
                        protWords);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Query Optimizer is estimating that the results of a join will have only
A query that is used to loop through 17 millions records to remove duplicates
I'm trying to figure out an elegant way to get a date from a
How can i make a query with results sorted by a calculated column? (I
What is the most efficient and elegant SQL query looking for a string containing
I'm wondering what the most elegant way is in C# to query a STRING
I have a database where I need to query to get records from one
The following LINQ query works fine except when there are no results to return.
I've had some success passing query results to my view. Unfortunately the ASP/Razor code
I am trying to create a query that will shift the results on each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.