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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:17:43+00:00 2026-06-18T15:17:43+00:00

I’m using solr4 with the TermsComponent Autosuggest (as described here ) We’re doing a

  • 0

I’m using solr4 with the TermsComponent Autosuggest (as described here)
We’re doing a regEx “startsWith”-search, that ignores upper/lower-case, the whole searchQuery looks like this:

<solr>/terms
?terms.fl=name
&terms=true
&terms.limit=5
&terms.regex=<term>.*
&terms.regex.flag=case_insensitive
&qt=%2Fterms

Let me give you a few examples what that returns:

test -> Test Listing; test lowercase
Test -> Test Listing; test lowercase

Unfortunately, this solution can’t handle diacritics, umlaute, accents .. So the following won’t work:

têst -> Test Listing; test lowercase; Têst áccènt
Test -> Test Listing; test lowercase; Têst áccènt

The field is a string – I’ve tried with a tokenized test_en as well, but without success

<field name="name" type="string" indexed="true" stored="true" required="true" />

What’s the best way to enable bidirectional accent-searching for this autosuggest?


Edit: Changes for AnalyzerSuggester:

  <searchComponent class="solr.SpellCheckComponent" name="autosuggest">
    <lst name="spellchecker">
      <str name="name">autosuggest</str>
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
      <str name="lookupImpl">org.apache.solr.spelling.suggest.fst.AnalyzingLookupFactory</str>
      <str name="storeDir">autosuggest</str>
      <str name="buildOnCommit">true</str>
      <str name="field">asug</str>
      <str name="suggestAnalyzerFieldType">text_asug</str>

      <!-- Suggester properties -->
      <bool name="exactMatchFirst">true</bool>
    </lst>
  </searchComponent>
  <requestHandler class="org.apache.solr.handler.component.SearchHandler" name="/autosuggest">
    <lst name="defaults">
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">autosuggest</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.count">5</str>
      <str name="spellcheck.collate">true</str>
    </lst>
    <arr name="components">
      <str>autosuggest</str>
    </arr>
  </requestHandler>

.

<fieldType name="text_asug" class="solr.TextField" positionIncrementGap="100">
        <analyzer type="index">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ASCIIFoldingFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.ASCIIFoldingFilterFactory"/>
      </analyzer>
    </fieldType>
  • 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-18T15:17:45+00:00Added an answer on June 18, 2026 at 3:17 pm

    The problem here is that the term component works on indexed tokens both for searching and query. So, if you do unicode folding (which is what you do), you will store folded text version. You will match it without accents, but then you will also get it back without accents too.

    I can think of two options:

    1) Store folded and non-folded term in one field. So somehow get “Têst áccènt” to map to “Test accent|Têst áccènt”. You match at the prefix “Test..” and then extract second term on the client. How to do that could be tricky though.

    2) Use Suggester instead. This builds on top of spell-checker and – if I read documentation properly – allows to specify alternative field_type, whose analyzers are used during suggester’s index/query (using barely-documented queryAnalyzerFieldType parameter in solrconfig.xml). So, your original text gets copied into suggester in folded form. But, presumable, once Suggester matches something, it will return the original form. However, I am not sure. Mostly because, it is advertised as a feature for just born Lucene/Solr 4.1 AnalyzingSuggester. In fact, the article specifically covers your use case:

    With an analyzer that folds or normalizes case, accents, etc. (e.g.,
    using ICUFoldingFilter), the suggestions will match irrespective of
    case and accents. For example, the query “ame…” would suggest
    Amélie.

    The problem is that you need to put together a complete example yourself at this point. There is very little guidance. But it (AnalyzingSuggester) is probably your best bet.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am using JSon response to parse title,date content and thumbnail images and place
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I've got a string that has curly quotes in it. I'd like to replace
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only

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.