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 8483121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:00:15+00:00 2026-06-10T20:00:15+00:00

My code is as below: SolrQuery query = new SolrQuery(); query.setQuery(q.trim()); try { QueryResponse

  • 0

My code is as below:

SolrQuery query = new SolrQuery();
    query.setQuery(q.trim());
try {
        QueryResponse res = getSolrServer().query(query);
        return res.getResults();
    } catch (SolrServerException sse) {
        log.error(sse);
    }

The problem is that when i have a query more then 3 characters this returns me the response, e.g. query string “che” would respond with results, however the query string “ch” would return me no response.
Is there a way i can override the 3 character min length of Solr Query.

is the below xml causing the problem, if yes can i programmatically override it using java

<analyzer type="index">
    <tokenizer class="solr.NGramTokenizerFactory" minGramSize="3" maxGramSize="50" />
    <filter class="solr.LowerCaseFilterFactory"/>
</analyzer>

Appreciate the help in Advance.

Thanks and Regards,

Vaibhav

  • 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-06-10T20:00:17+00:00Added an answer on June 10, 2026 at 8:00 pm

    NGramTokenizerFactory :-
    Default behavior. Note that this tokenizer operates over the whole field. It does not break the field at whitespace. As a result, the space character is included in the encoding.

    <analyzer>
      <tokenizer class="solr.NGramTokenizerFactory"/>
    </analyzer>
    

    In: “hey man”

    Out: “h”, “e”, “y”, ” “, “m”, “a”, “n”, “he”, “ey”, “y “, ” m”, “ma”, “an”

    So with your configurations :- minGramSize=”3″ maxGramSize=”50″ the items less then 3 would be filtered

    For two alphabets words, as you don’t have the terms in the index these would never be searchable. You would need to change the minGramSize to 2 to make them searchable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below is written in php: $user = addslashes($_POST['user']); $pwd = addslashes($_POST['pwd']); $query
Code below sets default values for new row if row is added using form.
Code below is a simple c# function return an int array. I would like
I have write below code String strId = 1,2 try { myDB = myDbHelper.openDataBase();
The code below takes a div and moves it on click. The return button
Code below is working well as long as I have class ClassSameAssembly in same
Code below is used to save PostgreSql database backup from browser in Apache Mono
The code below simply didn't work. document.getElementById('files').addEventListener('change', handleFileSelect, false); reported by firebug that this
This code below allows me to find the word error in all my files
The code below fails on the line: Class.forName(oracle.jdbc.driver.OracleDriver); with the error: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver The

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.