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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:00:23+00:00 2026-05-26T15:00:23+00:00

When running a search such as: field_name:# field_name:# field_name:\# where there is a record

  • 0

When running a search such as:

field_name:#
field_name:"#"
field_name:"\#"

where there is a record with the value of exactly “#”, Solr returns 0 rows.

The workaround we are having to use is to use a range query on the
field such as:

field_name:[# TO #]

and this returns the correct documents.

Use case details:
We have a field that indexes a text field and calculates a “letter
group”. This keeps only the first significant character from a value
(number or letter), and if it is a number the simply stores “#” as we
want all numbered items grouped together.

I’m also aware that we could also fix this by using a specific number
instead of the hash character, however, I though I’d raise this to see
if there is a wider issue. I’ve listed some specific details below.

Field definition:

<fieldType name="letterGrouping" class="solr.TextField" sortMissingLast="true" omitNorms="true">
<analyzer>
<tokenizer class="solr.PatternTokenizerFactory" pattern="^([a-zA-Z0-9]).*" group="1"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.TrimFilterFactory" />
<filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z0-9])" replacement="" replace="all"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="([0-9])" replacement="#" replace="all" />
</analyzer>
</fieldType>

Server information:

 Solr Specification Version: 3.2.0
 Solr Implementation Version: 3.2.0 1129474 - rmuir - 2011-05-30 23:07:15
 Lucene Specification Version: 3.2.0
 Lucene Implementation Version: 3.2.0 1129474 - 2011-05-30 23:08:57
  • 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-26T15:00:24+00:00Added an answer on May 26, 2026 at 3:00 pm

    The issue is the fieldtype is applied at both the index and query time.
    I tried to check the conversion for # for the fieldtype at query type and it seems to be returning blank.

    However, field_name:123 would return back the results, as the 123 should be converted to # and should match the indexed value.

    Or just apply the fieldType during index time.

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

Sidebar

Related Questions

I'm looking to get an instance of Solr search running on my localhost. The
I am trying to get a search web application running and needs to use
Is there a default folder where WEBrick will search for jars when running JRuby
I have a RegExp Tester extension in chrome. Running pattern [-,] against search text
I'm experimenting with the Search API with appengine, and am consistently running into the
I have a script that I'm running from the home directory to search for
Running Solr on Tomcat 7 on Win 2008 Server. I am looping through a
Google Desktop Search has this nice feature of catching monitor shortcuts (such as Ctrl
Multiple duplicates: https://stackoverflow.com/search?q=svnversion I'm using TortoiseSVN with SVN Service running as a service on
Suppose I have a search screen that is intended for looking up items. There

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.