skip to Main Content

i have three docs to be indexed into solr . sample of the 3 docs has been given below.

Doc 1:{ name:"alex" age:"25"}
Doc 2:{ name:"alex" age:"29"}
Doc 3:{ name:"benu" age:"29"}

Suggest me a way to index this.

2

Answers


  1. Chosen as BEST ANSWER

    In order to index the above 3 documents , i just removed the unique key( mentioned below) in the managed schema and it works perfectly.

     <uniqueKey>name</uniqueKey>
    

    In case if removing this throws a QueryElevate exception, remove the searchComponent named elevator in the solrconfig.


  2. So if name is not unique, why is it the uniqueKey?

    You have the option to give overwrite=false in the update request if you want to override the uniqueKey requirement for certain updates, but be aware that this will require that parameter to be present for any request that updates documents.

    It’s usually far better to assign a uniqueKey to each row (such as a uuid), or use an existing one (like the id of the row in the database).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search