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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:10:58+00:00 2026-05-21T09:10:58+00:00

I have some questions regarding the solr schema design. Basically I’m setting up a

  • 0

I have some questions regarding the solr schema design. Basically I’m setting up a search engine for product catalogue website and my table relationships are as follows.

  • Product Belongs to Merchant
  • Product Belongs to Brand
  • Product has and belongs to many Categories
  • Category has many Sub Categories
  • Sub Category has many Types
  • Type has many Sub Types

So far my Schema.xml is looks like this.

<field name="product_id" type="string" indexed="true" stored="true" required="true" /> 
<field name="name" type="string" indexed="true" stored="true"/>
<field name="merchant" type="string" indexed="true" stored="true"/>
<field name="merchant_id" type="string" indexed="true" stored="true"/>
<field name="brand" type="string" indexed="true" stored="true"/>
<field name="brand_id" type="string" indexed="true" stored="true"/>
<field name="categories" type="string" multiValued="true" indexed="true" stored="true"/>
<field name="sub_categories" type="string" multiValued="true" indexed="true" stored="true"/>
<field name="types" type="string" multiValued="true" indexed="true" stored="true"/>
<field name="sub_types" type="string" multiValued="true" indexed="true" stored="true"/>
<field name="price" type="float" indexed="true" stored="true"/>
<field name="description" type="text" indexed="true" stored="true"/>
<field name="image" type="text" indexed="true" stored="true"/>

<field name="text" type="text" indexed="true" stored="false" multiValued="true"/>

<uniqueKey>product_id</uniqueKey>

<defaultSearchField>text</defaultSearchField>

<solrQueryParser defaultOperator="OR"/>

<copyField source="name" dest="text"/>
<copyField source="merchant" dest="text"/>
<copyField source="brand" dest="text"/>
<copyField source="categories" dest="text"/>
<copyField source="sub_categories" dest="text"/>
<copyField source="types" dest="text"/>
<copyField source="sub_types" dest="text"/>

So my Questions now:

1) Is the Schema correct?

2) Let’s assume I need to find products for Category XYZ. My Senior programer doesn’t like querying the solr by Category Name, instead he wan’t to use CategoryID.
He is suggesting to store CategoryID_CategoryName (1001_Category XYZ) and from web front he is sending ID. (Assuming that Names with white spaces doesn’t work properly).

So to find the products I should then do a partial match of categories and identify the category id from the string i.e (fetch 1001 from 1001_Category XYZ)
or
What if I keep the Names on categories field and setup another field for category_ids? that’s seems a better option for me.

or

is there any Solr multi valued field type to store CategoryID and CategoryName together?

Let me know your thoughts, thanks.

  • 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-21T09:10:59+00:00Added an answer on May 21, 2026 at 9:10 am

    Answers to your questions.

    1. Maybe – it depends on how you plan on structuring your queries, what you intend to search and what you intend to retrieve in search results. In your schema, you’re storing & indexing everything which can be quite inefficient. Index what you intend to query, store what you intend to retrieve/display. If you were looking for optimizations, I would review the datatypes used in the schema – try to stay as native to the source type as you can.
    2. Querying by CategoryId – your programmer is correct, you want to query by category Id. Your approach of storing Ids and Names in separate fields is accurate as well. Presuming your Id-based fields are integers/longs, you don’t want to structure them as strings but rather as integers/longs.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some questions about logging, more specifically about setting it up and making
I have some questions regarding Max() What does the following query mean? SELECT MAX(X)
I came across this class while reading a C# book and have some questions.
I have some questions about basic CSS that I was unable to understand or
I have some questions about customers about NF mode for DB2. Google had very
I have some questions about multi-threaded programming and multi-core usage. In particular I'm wondering
I have some questions about Perl's map function. Specifically: How does %hash = map
I have some questions about partitioning and strategy, how and when to use it.
I've never used the Global Temporary Tables however I have some questions how they
There have been some questions about whether or not JavaScript is an object-oriented language.

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.