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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:38:33+00:00 2026-06-11T23:38:33+00:00

Can a unique key in Solr/Lucene schema be text_general instead? I have tried that

  • 0

Can a unique key in Solr/Lucene schema be text_general instead? I have tried that but Solr doesn’t overwrite the data, it simply adds another row hence duplicating the data.

I have commented out following from solrconfig.xml

<searchComponent name="elevator" class="solr.QueryElevationComponent" >
<!-- pick a fieldType to analyze queries -->
<str name="queryFieldType">string</str>
<str name="config-file">elevate.xml</str>
</searchComponent>

My schema.xml has

<uniqueKey>_id</uniqueKey>
<field name="_id" type="text_general" indexed="true" stored="true" default="NEW"/>

Any help would be greatly appreciated.

  • 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-11T23:38:35+00:00Added an answer on June 11, 2026 at 11:38 pm

    You can use whatever type you want for the uniqueKey field. As you can read from the documentation:

    The declaration can be used to inform Solr that there is a
    field in your index which should be unique for all documents. If a
    document is added that contains the same value for this field as an
    existing document, the old document will be deleted.

    It is not mandatory for a schema to have a uniqueKey field.

    Note that if you have enabled the QueryElevationComponent in
    solrconfig.xml it requires the schema to have a uniqueKey of type
    StrField. It cannot be, for example, an int field.

    What’s important is that your uniqueKey field is unique, meaning that the same document has the same identifier. Only that way the replace if existing mechanism can work. Using an uuid field type you’d never replace a document because you would have a different id for each one, automatically.

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

Sidebar

Related Questions

I have a Solr schema that has a url field: <fieldType name=url class=solr.TextField positionIncrementGap=100>
What’s the best way of generating a unique key, that can’t be guessed easily?
I have the following table: As you can see index_lang is a unique key
I have a column on my table which has unique key property, but i
How can I add a unique, auto-incrementing primary key ( IdCustomer ) in Rails?
I want to generate unique random, N-valued key. This key can contain numbers and
I wanted to know if we can have a unique identifier for all objects
Can I have an identity (unique, non-repeating) column span multiple tables? For example, let's
How can I drop the Unique Key Constraint on a column of a MySQL
How can i generate a unique key of length at most 12 character with

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.