Solr deep paging without sort












0















I have the following xml that indexed in solr:



<doc>
<field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 3</field>
<field name="author">moriarti</field>
<field name="price">20.5</field>
</doc>

<doc>
<field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado</field>
<field name="author">moriarti</field>
<field name="price">18</field>
</doc>

<doc>
<field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 2</field>
<field name="author">moriarti</field>
<field name="price">19.5</field>
</doc>


The next problem I have is that when I do a deep paging, it forces me to sort by id asc or id desc and then I can not sort by "title".
I have tried to use the default search field (df), but the result is still wrong.
Would you know how I can solve it, so that I can order by title?



Thank you.










share|improve this question



























    0















    I have the following xml that indexed in solr:



    <doc>
    <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 3</field>
    <field name="author">moriarti</field>
    <field name="price">20.5</field>
    </doc>

    <doc>
    <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado</field>
    <field name="author">moriarti</field>
    <field name="price">18</field>
    </doc>

    <doc>
    <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 2</field>
    <field name="author">moriarti</field>
    <field name="price">19.5</field>
    </doc>


    The next problem I have is that when I do a deep paging, it forces me to sort by id asc or id desc and then I can not sort by "title".
    I have tried to use the default search field (df), but the result is still wrong.
    Would you know how I can solve it, so that I can order by title?



    Thank you.










    share|improve this question

























      0












      0








      0


      1






      I have the following xml that indexed in solr:



      <doc>
      <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 3</field>
      <field name="author">moriarti</field>
      <field name="price">20.5</field>
      </doc>

      <doc>
      <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado</field>
      <field name="author">moriarti</field>
      <field name="price">18</field>
      </doc>

      <doc>
      <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 2</field>
      <field name="author">moriarti</field>
      <field name="price">19.5</field>
      </doc>


      The next problem I have is that when I do a deep paging, it forces me to sort by id asc or id desc and then I can not sort by "title".
      I have tried to use the default search field (df), but the result is still wrong.
      Would you know how I can solve it, so that I can order by title?



      Thank you.










      share|improve this question














      I have the following xml that indexed in solr:



      <doc>
      <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 3</field>
      <field name="author">moriarti</field>
      <field name="price">20.5</field>
      </doc>

      <doc>
      <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado</field>
      <field name="author">moriarti</field>
      <field name="price">18</field>
      </doc>

      <doc>
      <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" >Sharknado 2</field>
      <field name="author">moriarti</field>
      <field name="price">19.5</field>
      </doc>


      The next problem I have is that when I do a deep paging, it forces me to sort by id asc or id desc and then I can not sort by "title".
      I have tried to use the default search field (df), but the result is still wrong.
      Would you know how I can solve it, so that I can order by title?



      Thank you.







      solr paging solrj






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 '18 at 9:48









      Javier MoralesJavier Morales

      12




      12
























          2 Answers
          2






          active

          oldest

          votes


















          2














          The field definition (with type, etc.) goes into your schema, not in the update XML.



          Sorting by an analyzed TextField is not a good idea either, as you'll not get the result you're looking for. If you want to search by a textual field, sort by a string field, or a field with a KeywordTokenizer and a lowercasefilter (if you want to make the sort case insensitive).



          The rule is only that the id field (or more specific - the uniqueKey field which can be named something else than id, but usually is just id) - has to be present in the sort order. It does not have to be the first one, it just has to be there so a sort is stable.



          sort=title asc, id asc


          .. is perfectly valid for using cursorMarks for deep paging.



          To further explain after your comment



          A Tokenizer is what tells Solr how to split the input text into what's called "Tokens". A token is what a match is being performed against. The Whitespace Tokenizer will splitt "this is a text" into four tokens, this, is, a and text. When you search for just text or this text, the same process happens, then the inputted and stored tokens are compared to see if there's a match.



          A sort is also performed on the tokens, so if you try to sort on the text "c b a", it'll be tokenized to c, b and a - and that isn't really useful for sorting, since you'd expect anything starting with c to be sorted after b, but you now have three tokens for the document indicating its actual value. This process usually gives you weird and non-intuitive results.



          Instead, use a string field, as this keeps the input as a single token. If you store a b c, the whole text is stored as a single token - a b c and not broken up to smaller pieces. This also means that you'll only get hits if the input and stored text matches exactly, since it's a single, large token (and tokens are what determines matches).



          But since a string field doesn't do anything, you might want to sort a and A as the same character, instead of sorting capital letters first. The way to do this is to have a Tokenizer named KeywordTokenizer - the KeywordTokenizer doesn't split the input text into tokens, but keeps everything as a single token. This seems useless since it's the same as what a string field does, but a TextField with a Tokenizer allows you to attach filters to the analysis chain - which a string field doesn't. So you can add a LowercaseFilter to the chain, and thus, the tokens generated for a and A will be the same - a in both cases.



          You configure field types and their associated processing in schema.xml or through the Schema API. You can use copyField to tell Solr "anything that goes into this field, should also be added to this other field" - that way you can have your content appear in multiple fields and be processed differently - one way for searching (tokenized on whitespace for example) and one way for searching (not tokenized at all).



          The syntax you've used for one of your fields in your documents XML, is not meant to be used in that context - but when defining the field in schema.xml:



          <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" />


          In your document it should be just:



          <field name="title">value</field>


          The processing and parameters will be based on the field type defined in schema.xml.






          share|improve this answer


























          • Thanks for your prompt response, but could you show me an example? I do not understand if I should modify the schema.xml of solr or the xml that I try to index. I also do not understand what a tokenizer is and how to apply it. Thanks again.

            – Javier Morales
            Nov 13 '18 at 11:18











          • I've added a section that explains what tokenizers and filters are.

            – MatsLindh
            Nov 13 '18 at 12:13



















          0














          Finally I have solved it,
          After investigating a little about the tokenizers and trying several things...



          First: I modified the solrconfig.xml to be able to edit it manually.
          I added:



          <schemaFactory class="ManagedIndexSchemaFactory">
          <bool name="mutable">true</bool>
          <str name="managedSchemaResourceName">managed-schema</str>
          </schemaFactory>


          as indicated here.



          Second: I changed in manage-schema.xml the following for my field:



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


          Third:
          I ordered by score and by title, in the following way in solrj:



          query.addSort("score", ORDER.desc);
          query.addSort("title", ORDER.asc);
          query.addSort("id", ORDER.desc);


          I also have as parameter in solrj:



          query.setParam ("df", "title");


          In this way, it returns the results correctly.
          Thanks for your time MatsLindh.






          share|improve this answer

























            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%2f53278148%2fsolr-deep-paging-without-sort%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









            2














            The field definition (with type, etc.) goes into your schema, not in the update XML.



            Sorting by an analyzed TextField is not a good idea either, as you'll not get the result you're looking for. If you want to search by a textual field, sort by a string field, or a field with a KeywordTokenizer and a lowercasefilter (if you want to make the sort case insensitive).



            The rule is only that the id field (or more specific - the uniqueKey field which can be named something else than id, but usually is just id) - has to be present in the sort order. It does not have to be the first one, it just has to be there so a sort is stable.



            sort=title asc, id asc


            .. is perfectly valid for using cursorMarks for deep paging.



            To further explain after your comment



            A Tokenizer is what tells Solr how to split the input text into what's called "Tokens". A token is what a match is being performed against. The Whitespace Tokenizer will splitt "this is a text" into four tokens, this, is, a and text. When you search for just text or this text, the same process happens, then the inputted and stored tokens are compared to see if there's a match.



            A sort is also performed on the tokens, so if you try to sort on the text "c b a", it'll be tokenized to c, b and a - and that isn't really useful for sorting, since you'd expect anything starting with c to be sorted after b, but you now have three tokens for the document indicating its actual value. This process usually gives you weird and non-intuitive results.



            Instead, use a string field, as this keeps the input as a single token. If you store a b c, the whole text is stored as a single token - a b c and not broken up to smaller pieces. This also means that you'll only get hits if the input and stored text matches exactly, since it's a single, large token (and tokens are what determines matches).



            But since a string field doesn't do anything, you might want to sort a and A as the same character, instead of sorting capital letters first. The way to do this is to have a Tokenizer named KeywordTokenizer - the KeywordTokenizer doesn't split the input text into tokens, but keeps everything as a single token. This seems useless since it's the same as what a string field does, but a TextField with a Tokenizer allows you to attach filters to the analysis chain - which a string field doesn't. So you can add a LowercaseFilter to the chain, and thus, the tokens generated for a and A will be the same - a in both cases.



            You configure field types and their associated processing in schema.xml or through the Schema API. You can use copyField to tell Solr "anything that goes into this field, should also be added to this other field" - that way you can have your content appear in multiple fields and be processed differently - one way for searching (tokenized on whitespace for example) and one way for searching (not tokenized at all).



            The syntax you've used for one of your fields in your documents XML, is not meant to be used in that context - but when defining the field in schema.xml:



            <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" />


            In your document it should be just:



            <field name="title">value</field>


            The processing and parameters will be based on the field type defined in schema.xml.






            share|improve this answer


























            • Thanks for your prompt response, but could you show me an example? I do not understand if I should modify the schema.xml of solr or the xml that I try to index. I also do not understand what a tokenizer is and how to apply it. Thanks again.

              – Javier Morales
              Nov 13 '18 at 11:18











            • I've added a section that explains what tokenizers and filters are.

              – MatsLindh
              Nov 13 '18 at 12:13
















            2














            The field definition (with type, etc.) goes into your schema, not in the update XML.



            Sorting by an analyzed TextField is not a good idea either, as you'll not get the result you're looking for. If you want to search by a textual field, sort by a string field, or a field with a KeywordTokenizer and a lowercasefilter (if you want to make the sort case insensitive).



            The rule is only that the id field (or more specific - the uniqueKey field which can be named something else than id, but usually is just id) - has to be present in the sort order. It does not have to be the first one, it just has to be there so a sort is stable.



            sort=title asc, id asc


            .. is perfectly valid for using cursorMarks for deep paging.



            To further explain after your comment



            A Tokenizer is what tells Solr how to split the input text into what's called "Tokens". A token is what a match is being performed against. The Whitespace Tokenizer will splitt "this is a text" into four tokens, this, is, a and text. When you search for just text or this text, the same process happens, then the inputted and stored tokens are compared to see if there's a match.



            A sort is also performed on the tokens, so if you try to sort on the text "c b a", it'll be tokenized to c, b and a - and that isn't really useful for sorting, since you'd expect anything starting with c to be sorted after b, but you now have three tokens for the document indicating its actual value. This process usually gives you weird and non-intuitive results.



            Instead, use a string field, as this keeps the input as a single token. If you store a b c, the whole text is stored as a single token - a b c and not broken up to smaller pieces. This also means that you'll only get hits if the input and stored text matches exactly, since it's a single, large token (and tokens are what determines matches).



            But since a string field doesn't do anything, you might want to sort a and A as the same character, instead of sorting capital letters first. The way to do this is to have a Tokenizer named KeywordTokenizer - the KeywordTokenizer doesn't split the input text into tokens, but keeps everything as a single token. This seems useless since it's the same as what a string field does, but a TextField with a Tokenizer allows you to attach filters to the analysis chain - which a string field doesn't. So you can add a LowercaseFilter to the chain, and thus, the tokens generated for a and A will be the same - a in both cases.



            You configure field types and their associated processing in schema.xml or through the Schema API. You can use copyField to tell Solr "anything that goes into this field, should also be added to this other field" - that way you can have your content appear in multiple fields and be processed differently - one way for searching (tokenized on whitespace for example) and one way for searching (not tokenized at all).



            The syntax you've used for one of your fields in your documents XML, is not meant to be used in that context - but when defining the field in schema.xml:



            <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" />


            In your document it should be just:



            <field name="title">value</field>


            The processing and parameters will be based on the field type defined in schema.xml.






            share|improve this answer


























            • Thanks for your prompt response, but could you show me an example? I do not understand if I should modify the schema.xml of solr or the xml that I try to index. I also do not understand what a tokenizer is and how to apply it. Thanks again.

              – Javier Morales
              Nov 13 '18 at 11:18











            • I've added a section that explains what tokenizers and filters are.

              – MatsLindh
              Nov 13 '18 at 12:13














            2












            2








            2







            The field definition (with type, etc.) goes into your schema, not in the update XML.



            Sorting by an analyzed TextField is not a good idea either, as you'll not get the result you're looking for. If you want to search by a textual field, sort by a string field, or a field with a KeywordTokenizer and a lowercasefilter (if you want to make the sort case insensitive).



            The rule is only that the id field (or more specific - the uniqueKey field which can be named something else than id, but usually is just id) - has to be present in the sort order. It does not have to be the first one, it just has to be there so a sort is stable.



            sort=title asc, id asc


            .. is perfectly valid for using cursorMarks for deep paging.



            To further explain after your comment



            A Tokenizer is what tells Solr how to split the input text into what's called "Tokens". A token is what a match is being performed against. The Whitespace Tokenizer will splitt "this is a text" into four tokens, this, is, a and text. When you search for just text or this text, the same process happens, then the inputted and stored tokens are compared to see if there's a match.



            A sort is also performed on the tokens, so if you try to sort on the text "c b a", it'll be tokenized to c, b and a - and that isn't really useful for sorting, since you'd expect anything starting with c to be sorted after b, but you now have three tokens for the document indicating its actual value. This process usually gives you weird and non-intuitive results.



            Instead, use a string field, as this keeps the input as a single token. If you store a b c, the whole text is stored as a single token - a b c and not broken up to smaller pieces. This also means that you'll only get hits if the input and stored text matches exactly, since it's a single, large token (and tokens are what determines matches).



            But since a string field doesn't do anything, you might want to sort a and A as the same character, instead of sorting capital letters first. The way to do this is to have a Tokenizer named KeywordTokenizer - the KeywordTokenizer doesn't split the input text into tokens, but keeps everything as a single token. This seems useless since it's the same as what a string field does, but a TextField with a Tokenizer allows you to attach filters to the analysis chain - which a string field doesn't. So you can add a LowercaseFilter to the chain, and thus, the tokens generated for a and A will be the same - a in both cases.



            You configure field types and their associated processing in schema.xml or through the Schema API. You can use copyField to tell Solr "anything that goes into this field, should also be added to this other field" - that way you can have your content appear in multiple fields and be processed differently - one way for searching (tokenized on whitespace for example) and one way for searching (not tokenized at all).



            The syntax you've used for one of your fields in your documents XML, is not meant to be used in that context - but when defining the field in schema.xml:



            <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" />


            In your document it should be just:



            <field name="title">value</field>


            The processing and parameters will be based on the field type defined in schema.xml.






            share|improve this answer















            The field definition (with type, etc.) goes into your schema, not in the update XML.



            Sorting by an analyzed TextField is not a good idea either, as you'll not get the result you're looking for. If you want to search by a textual field, sort by a string field, or a field with a KeywordTokenizer and a lowercasefilter (if you want to make the sort case insensitive).



            The rule is only that the id field (or more specific - the uniqueKey field which can be named something else than id, but usually is just id) - has to be present in the sort order. It does not have to be the first one, it just has to be there so a sort is stable.



            sort=title asc, id asc


            .. is perfectly valid for using cursorMarks for deep paging.



            To further explain after your comment



            A Tokenizer is what tells Solr how to split the input text into what's called "Tokens". A token is what a match is being performed against. The Whitespace Tokenizer will splitt "this is a text" into four tokens, this, is, a and text. When you search for just text or this text, the same process happens, then the inputted and stored tokens are compared to see if there's a match.



            A sort is also performed on the tokens, so if you try to sort on the text "c b a", it'll be tokenized to c, b and a - and that isn't really useful for sorting, since you'd expect anything starting with c to be sorted after b, but you now have three tokens for the document indicating its actual value. This process usually gives you weird and non-intuitive results.



            Instead, use a string field, as this keeps the input as a single token. If you store a b c, the whole text is stored as a single token - a b c and not broken up to smaller pieces. This also means that you'll only get hits if the input and stored text matches exactly, since it's a single, large token (and tokens are what determines matches).



            But since a string field doesn't do anything, you might want to sort a and A as the same character, instead of sorting capital letters first. The way to do this is to have a Tokenizer named KeywordTokenizer - the KeywordTokenizer doesn't split the input text into tokens, but keeps everything as a single token. This seems useless since it's the same as what a string field does, but a TextField with a Tokenizer allows you to attach filters to the analysis chain - which a string field doesn't. So you can add a LowercaseFilter to the chain, and thus, the tokens generated for a and A will be the same - a in both cases.



            You configure field types and their associated processing in schema.xml or through the Schema API. You can use copyField to tell Solr "anything that goes into this field, should also be added to this other field" - that way you can have your content appear in multiple fields and be processed differently - one way for searching (tokenized on whitespace for example) and one way for searching (not tokenized at all).



            The syntax you've used for one of your fields in your documents XML, is not meant to be used in that context - but when defining the field in schema.xml:



            <field name="title" type="text_general" class="solr.TextField" indexed="true" stored="true" required="true" multiValued="false" />


            In your document it should be just:



            <field name="title">value</field>


            The processing and parameters will be based on the field type defined in schema.xml.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 13 '18 at 12:09

























            answered Nov 13 '18 at 10:38









            MatsLindhMatsLindh

            25k22241




            25k22241













            • Thanks for your prompt response, but could you show me an example? I do not understand if I should modify the schema.xml of solr or the xml that I try to index. I also do not understand what a tokenizer is and how to apply it. Thanks again.

              – Javier Morales
              Nov 13 '18 at 11:18











            • I've added a section that explains what tokenizers and filters are.

              – MatsLindh
              Nov 13 '18 at 12:13



















            • Thanks for your prompt response, but could you show me an example? I do not understand if I should modify the schema.xml of solr or the xml that I try to index. I also do not understand what a tokenizer is and how to apply it. Thanks again.

              – Javier Morales
              Nov 13 '18 at 11:18











            • I've added a section that explains what tokenizers and filters are.

              – MatsLindh
              Nov 13 '18 at 12:13

















            Thanks for your prompt response, but could you show me an example? I do not understand if I should modify the schema.xml of solr or the xml that I try to index. I also do not understand what a tokenizer is and how to apply it. Thanks again.

            – Javier Morales
            Nov 13 '18 at 11:18





            Thanks for your prompt response, but could you show me an example? I do not understand if I should modify the schema.xml of solr or the xml that I try to index. I also do not understand what a tokenizer is and how to apply it. Thanks again.

            – Javier Morales
            Nov 13 '18 at 11:18













            I've added a section that explains what tokenizers and filters are.

            – MatsLindh
            Nov 13 '18 at 12:13





            I've added a section that explains what tokenizers and filters are.

            – MatsLindh
            Nov 13 '18 at 12:13













            0














            Finally I have solved it,
            After investigating a little about the tokenizers and trying several things...



            First: I modified the solrconfig.xml to be able to edit it manually.
            I added:



            <schemaFactory class="ManagedIndexSchemaFactory">
            <bool name="mutable">true</bool>
            <str name="managedSchemaResourceName">managed-schema</str>
            </schemaFactory>


            as indicated here.



            Second: I changed in manage-schema.xml the following for my field:



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


            Third:
            I ordered by score and by title, in the following way in solrj:



            query.addSort("score", ORDER.desc);
            query.addSort("title", ORDER.asc);
            query.addSort("id", ORDER.desc);


            I also have as parameter in solrj:



            query.setParam ("df", "title");


            In this way, it returns the results correctly.
            Thanks for your time MatsLindh.






            share|improve this answer






























              0














              Finally I have solved it,
              After investigating a little about the tokenizers and trying several things...



              First: I modified the solrconfig.xml to be able to edit it manually.
              I added:



              <schemaFactory class="ManagedIndexSchemaFactory">
              <bool name="mutable">true</bool>
              <str name="managedSchemaResourceName">managed-schema</str>
              </schemaFactory>


              as indicated here.



              Second: I changed in manage-schema.xml the following for my field:



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


              Third:
              I ordered by score and by title, in the following way in solrj:



              query.addSort("score", ORDER.desc);
              query.addSort("title", ORDER.asc);
              query.addSort("id", ORDER.desc);


              I also have as parameter in solrj:



              query.setParam ("df", "title");


              In this way, it returns the results correctly.
              Thanks for your time MatsLindh.






              share|improve this answer




























                0












                0








                0







                Finally I have solved it,
                After investigating a little about the tokenizers and trying several things...



                First: I modified the solrconfig.xml to be able to edit it manually.
                I added:



                <schemaFactory class="ManagedIndexSchemaFactory">
                <bool name="mutable">true</bool>
                <str name="managedSchemaResourceName">managed-schema</str>
                </schemaFactory>


                as indicated here.



                Second: I changed in manage-schema.xml the following for my field:



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


                Third:
                I ordered by score and by title, in the following way in solrj:



                query.addSort("score", ORDER.desc);
                query.addSort("title", ORDER.asc);
                query.addSort("id", ORDER.desc);


                I also have as parameter in solrj:



                query.setParam ("df", "title");


                In this way, it returns the results correctly.
                Thanks for your time MatsLindh.






                share|improve this answer















                Finally I have solved it,
                After investigating a little about the tokenizers and trying several things...



                First: I modified the solrconfig.xml to be able to edit it manually.
                I added:



                <schemaFactory class="ManagedIndexSchemaFactory">
                <bool name="mutable">true</bool>
                <str name="managedSchemaResourceName">managed-schema</str>
                </schemaFactory>


                as indicated here.



                Second: I changed in manage-schema.xml the following for my field:



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


                Third:
                I ordered by score and by title, in the following way in solrj:



                query.addSort("score", ORDER.desc);
                query.addSort("title", ORDER.asc);
                query.addSort("id", ORDER.desc);


                I also have as parameter in solrj:



                query.setParam ("df", "title");


                In this way, it returns the results correctly.
                Thanks for your time MatsLindh.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 16 '18 at 17:49

























                answered Nov 13 '18 at 18:05









                Javier MoralesJavier Morales

                12




                12






























                    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%2f53278148%2fsolr-deep-paging-without-sort%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