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

  • Home
  • SEARCH
  • 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 8969599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:36:57+00:00 2026-06-15T17:36:57+00:00

Am implementing full-text search using solr and I would appreciate it if someone could

  • 0

Am implementing full-text search using solr and I would appreciate it if someone could offer me some help with some problem am facing.

My schema.xml looks as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="products" version="1.2">
    <types>
        <fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
            <fieldType name="concatenated" class="solr.TextField" positionIncrementGap="100" >
                <analyzer>
                <tokenizer class="solr.LowerCaseTokenizerFactory"/>
                <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="15" side="front"/>
                <filter class="solr.WordDelimiterFilterFactory"
                    splitOnCaseChange="0"
                    splitOnNumerics="1"
                            catenateWords="1"
                            catenateNumbers="1"
                            catenateAll="1"
                            preserveOriginal="1"
                    />
                </analyzer>
            </fieldType>
    </types>
    <fields>
        <field name="keyid" type="long" indexed="true" stored="false" required="true"/>
        <field name="combined" type="concatenated" indexed="true" stored="false"/>
    </fields>
    <uniqueKey>keyid</uniqueKey>
    <defaultSearchField>combined</defaultSearchField> 
    <copyField source="keyid" dest="keyid"/>  
    <solrQueryParser defaultOperator="OR"/>
</schema>

And my data-config.xml file looks as follows:

<dataConfig>
    <document name="products">
        <entity name="product" query="SELECT ProductId AS keyid, CONVERT(VARCHAR(18), ProductId) + ' ' + ProductName AS combined FROM Products"
            <field column="keyid" name="keyid"/>
            <field column="combined" name="combined"/>
        </entity>
    </document>
</dataConfig>

And I have a record like follows in my Products table

ProductId|ProductName

239289231|Windows 7

Assuming a successful setup and indexing (using localhost:8089/sorl/dataimport?command=full-import), why would I not get results when I run this query:

Scenario 1:localhost:8089/solr/select?q=combined:239289233

Yet the queries below do give me results (one searching from the keyid field and another from the combined field):

Scenario 2:localhost:8089/solr/select?q=combined:Windows

Scenario 3:localhost:8089/solr/select?q=keyid:239289233

Is the problem the TokenizerFactory or FilterFactory that am using here? Shouldn’t Solr treat ProductId as a string after its cast to VARCHAR and concatenated – hence make it possible to call it out the way am doing in Scenario 1?

  • 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-15T17:36:58+00:00Added an answer on June 15, 2026 at 5:36 pm

    Yes, the issue here is the tokenizers. Your first tokenizer, the LowerCaseTokenizerFactory completely strips off the numbers, so that is why you cannot find search and find any values with your ProductId values. In your example case, it is only indexing the word Windows.

    I am assuming you perhaps want to lowercase the value, so you would want to use the StandardTokenizerFactory as your tokenizer, and LowerCaseFilterFactory as a filter to lowercase the values. That will include the ProductId value as a token to be indexed and have NGrams built against the following tokens – 239289231, Windows and 7.

    Here is a suggested modified fieldType

      <fieldType name="concatenated" class="solr.TextField" positionIncrementGap="100" >
         <analyzer>
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" 
                maxGramSize="15" side="front"/>
            <filter class="solr.WordDelimiterFilterFactory"
                 splitOnCaseChange="0"
                 splitOnNumerics="1"
                 catenateWords="1"
                 catenateNumbers="1"
                 catenateAll="1"
                 preserveOriginal="1"
                 />
          </analyzer>
       </fieldType>
    

    Also, I would recommend reviewing the Analyzers, Tokenizers and Token Filters page on the Solr Wiki for examples of how the various ones work, if you have not already. In this case it was just a mix up between a tokenizer and a filter I believe.

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

Sidebar

Related Questions

I'm implementing full text search functionality on my rap website , and I'm running
I am implementing a full text search API for my rails apps, and so
I'm looking into implementing full text search on our Firebird database. Our requirements are:
I'm working with SQL trying to implement a Full-Text-Search. I noticed that there is
I am building a full text search facility for my website coded in asp.net
I am implementing a simple portal using jsp and struts, the user full fill
I'm currently working on implementing a fulltext search engine for one of our sites,
implementing publishActivity in PHP using the REST API using this code: $activity = array(
Implementing a simple Login screen using JSF and Spring and Hibernate. I have written
When implementing a hash table using a good hash function (one where the probability

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.