index records with similar value in solr





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-1















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.










share|improve this question























  • There are no special requirements to index this in Solr. What issue are you running into?

    – MatsLindh
    Nov 16 '18 at 20:14











  • @MatsLindh the unique key is "name" here . Since there are 2 names with the value as alex , only one is getting indexed.

    – UMA MAHESWAR
    Nov 19 '18 at 4:36


















-1















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.










share|improve this question























  • There are no special requirements to index this in Solr. What issue are you running into?

    – MatsLindh
    Nov 16 '18 at 20:14











  • @MatsLindh the unique key is "name" here . Since there are 2 names with the value as alex , only one is getting indexed.

    – UMA MAHESWAR
    Nov 19 '18 at 4:36














-1












-1








-1








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.










share|improve this question














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.







apache tomcat solr solrj solrcloud






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 11:20









UMA MAHESWARUMA MAHESWAR

276




276













  • There are no special requirements to index this in Solr. What issue are you running into?

    – MatsLindh
    Nov 16 '18 at 20:14











  • @MatsLindh the unique key is "name" here . Since there are 2 names with the value as alex , only one is getting indexed.

    – UMA MAHESWAR
    Nov 19 '18 at 4:36



















  • There are no special requirements to index this in Solr. What issue are you running into?

    – MatsLindh
    Nov 16 '18 at 20:14











  • @MatsLindh the unique key is "name" here . Since there are 2 names with the value as alex , only one is getting indexed.

    – UMA MAHESWAR
    Nov 19 '18 at 4:36

















There are no special requirements to index this in Solr. What issue are you running into?

– MatsLindh
Nov 16 '18 at 20:14





There are no special requirements to index this in Solr. What issue are you running into?

– MatsLindh
Nov 16 '18 at 20:14













@MatsLindh the unique key is "name" here . Since there are 2 names with the value as alex , only one is getting indexed.

– UMA MAHESWAR
Nov 19 '18 at 4:36





@MatsLindh the unique key is "name" here . Since there are 2 names with the value as alex , only one is getting indexed.

– UMA MAHESWAR
Nov 19 '18 at 4:36












2 Answers
2






active

oldest

votes


















0














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).






share|improve this answer































    0














    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.






    share|improve this answer
























    • @MatsLindh this approach worked for me Sir.

      – UMA MAHESWAR
      Nov 20 '18 at 5:39











    • But not having a uniqueKey will break many features in Solr. It's far from an ideal situation.

      – MatsLindh
      Nov 20 '18 at 9:11











    • @MatsLindh can you please quote some major disadvantages that we have if we remove the uniquekey feature in schema?

      – UMA MAHESWAR
      Nov 20 '18 at 11:21






    • 1





      You won't be able to use efficient deep pagination using cursorMarks, you won't be able to update an existing document, you won't be able to explicitly delete one document of a set of duplicates (where information is identical). Any operation that requires referencing one specific document will either be more complicated if the feature supports giving it a query (and at least one field differ between them), or impossible to retrieve. Some Streaming Expressions require a unique id for a document, etc. Add a unique key.

      – MatsLindh
      Nov 20 '18 at 12:25














    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53336854%2findex-records-with-similar-value-in-solr%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    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).






    share|improve this answer




























      0














      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).






      share|improve this answer


























        0












        0








        0







        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).






        share|improve this answer













        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).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 19 '18 at 7:42









        MatsLindhMatsLindh

        26.1k32342




        26.1k32342

























            0














            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.






            share|improve this answer
























            • @MatsLindh this approach worked for me Sir.

              – UMA MAHESWAR
              Nov 20 '18 at 5:39











            • But not having a uniqueKey will break many features in Solr. It's far from an ideal situation.

              – MatsLindh
              Nov 20 '18 at 9:11











            • @MatsLindh can you please quote some major disadvantages that we have if we remove the uniquekey feature in schema?

              – UMA MAHESWAR
              Nov 20 '18 at 11:21






            • 1





              You won't be able to use efficient deep pagination using cursorMarks, you won't be able to update an existing document, you won't be able to explicitly delete one document of a set of duplicates (where information is identical). Any operation that requires referencing one specific document will either be more complicated if the feature supports giving it a query (and at least one field differ between them), or impossible to retrieve. Some Streaming Expressions require a unique id for a document, etc. Add a unique key.

              – MatsLindh
              Nov 20 '18 at 12:25


















            0














            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.






            share|improve this answer
























            • @MatsLindh this approach worked for me Sir.

              – UMA MAHESWAR
              Nov 20 '18 at 5:39











            • But not having a uniqueKey will break many features in Solr. It's far from an ideal situation.

              – MatsLindh
              Nov 20 '18 at 9:11











            • @MatsLindh can you please quote some major disadvantages that we have if we remove the uniquekey feature in schema?

              – UMA MAHESWAR
              Nov 20 '18 at 11:21






            • 1





              You won't be able to use efficient deep pagination using cursorMarks, you won't be able to update an existing document, you won't be able to explicitly delete one document of a set of duplicates (where information is identical). Any operation that requires referencing one specific document will either be more complicated if the feature supports giving it a query (and at least one field differ between them), or impossible to retrieve. Some Streaming Expressions require a unique id for a document, etc. Add a unique key.

              – MatsLindh
              Nov 20 '18 at 12:25
















            0












            0








            0







            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.






            share|improve this 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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 20 '18 at 5:37









            UMA MAHESWARUMA MAHESWAR

            276




            276













            • @MatsLindh this approach worked for me Sir.

              – UMA MAHESWAR
              Nov 20 '18 at 5:39











            • But not having a uniqueKey will break many features in Solr. It's far from an ideal situation.

              – MatsLindh
              Nov 20 '18 at 9:11











            • @MatsLindh can you please quote some major disadvantages that we have if we remove the uniquekey feature in schema?

              – UMA MAHESWAR
              Nov 20 '18 at 11:21






            • 1





              You won't be able to use efficient deep pagination using cursorMarks, you won't be able to update an existing document, you won't be able to explicitly delete one document of a set of duplicates (where information is identical). Any operation that requires referencing one specific document will either be more complicated if the feature supports giving it a query (and at least one field differ between them), or impossible to retrieve. Some Streaming Expressions require a unique id for a document, etc. Add a unique key.

              – MatsLindh
              Nov 20 '18 at 12:25





















            • @MatsLindh this approach worked for me Sir.

              – UMA MAHESWAR
              Nov 20 '18 at 5:39











            • But not having a uniqueKey will break many features in Solr. It's far from an ideal situation.

              – MatsLindh
              Nov 20 '18 at 9:11











            • @MatsLindh can you please quote some major disadvantages that we have if we remove the uniquekey feature in schema?

              – UMA MAHESWAR
              Nov 20 '18 at 11:21






            • 1





              You won't be able to use efficient deep pagination using cursorMarks, you won't be able to update an existing document, you won't be able to explicitly delete one document of a set of duplicates (where information is identical). Any operation that requires referencing one specific document will either be more complicated if the feature supports giving it a query (and at least one field differ between them), or impossible to retrieve. Some Streaming Expressions require a unique id for a document, etc. Add a unique key.

              – MatsLindh
              Nov 20 '18 at 12:25



















            @MatsLindh this approach worked for me Sir.

            – UMA MAHESWAR
            Nov 20 '18 at 5:39





            @MatsLindh this approach worked for me Sir.

            – UMA MAHESWAR
            Nov 20 '18 at 5:39













            But not having a uniqueKey will break many features in Solr. It's far from an ideal situation.

            – MatsLindh
            Nov 20 '18 at 9:11





            But not having a uniqueKey will break many features in Solr. It's far from an ideal situation.

            – MatsLindh
            Nov 20 '18 at 9:11













            @MatsLindh can you please quote some major disadvantages that we have if we remove the uniquekey feature in schema?

            – UMA MAHESWAR
            Nov 20 '18 at 11:21





            @MatsLindh can you please quote some major disadvantages that we have if we remove the uniquekey feature in schema?

            – UMA MAHESWAR
            Nov 20 '18 at 11:21




            1




            1





            You won't be able to use efficient deep pagination using cursorMarks, you won't be able to update an existing document, you won't be able to explicitly delete one document of a set of duplicates (where information is identical). Any operation that requires referencing one specific document will either be more complicated if the feature supports giving it a query (and at least one field differ between them), or impossible to retrieve. Some Streaming Expressions require a unique id for a document, etc. Add a unique key.

            – MatsLindh
            Nov 20 '18 at 12:25







            You won't be able to use efficient deep pagination using cursorMarks, you won't be able to update an existing document, you won't be able to explicitly delete one document of a set of duplicates (where information is identical). Any operation that requires referencing one specific document will either be more complicated if the feature supports giving it a query (and at least one field differ between them), or impossible to retrieve. Some Streaming Expressions require a unique id for a document, etc. Add a unique key.

            – MatsLindh
            Nov 20 '18 at 12:25




















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53336854%2findex-records-with-similar-value-in-solr%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Danny Elfman

            Lugert, Oklahoma