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

The Archive Base Latest Questions

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

I’ve got the following class: public class Product { public Product() { Categories =

  • 0

I’ve got the following class:

public class Product
{
    public Product()
    {
        Categories = new List<Category>();
    }

    [SolrUniqueKey("id")]
    public int Id { get; set; }

    [SolrField("name")]
    public string Name { get; set; }

    [SolrField("cat")]
    public virtual List<Category> Categories { get; set; }        
}

Now I fill solr with 100 products.
The name of the products is based on testitem[i] where i is the number of the product. (0-99).

Now this same goes for the categories, which work fine. But when I ask for facets in the name I get the following result:

<int name="testitem">100</int>
<int name="0">1</int>
<int name="1">1</int>
<int name="10">1</int>
<int name="11">1</int>
<int name="12">1</int>
<int name="13">1</int>
<int name="14">1</int>
<int name="15">1</int>
<int name="16">1</int>
etc..

As you can see this isn’t right. It looks like solr splits the number from the string. The weird thing is that this doesn’t happen in the category facet.

Does anyone know what is going wrong / I’m doing wrong.

  • 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-07T01:15:12+00:00Added an answer on June 7, 2026 at 1:15 am

    More than likely this is because of the Solr field type you are using for your name field in your index. If you look closely at the fieldType definition in the schema.xml for the name, it is probably text_general and those fields tokenize the values you input into them, so that is what is splitting your name values into text and number values. In this case, I would suggest using a separate field for storing the faceting values and use the Copy Field directive to move the name value to this new field.

    So your schema would look something like this…

     <field name="name" type="text_general" stored="true" indexed="true" />
     <field name="name_facet" type="string" stored="true" indexed="true" />
    
     <copyField source="name" dest="name_facet" />
    

    Then run your facet query against the name_facet field and you should see the expected results.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
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
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
i got an object with contents of html markup in it, for example: string
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.